Changeset - 280c8767e577
[Not reviewed]
default
0 4 0
Mads Kiilerich (mads) - 6 years ago 2019-11-23 22:21:28
mads@kiilerich.com
Grafted from: 4c453a3d6232
cleanup: use isinstance instead of comparing types

From 2to3 idioms.
4 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/rcmail/response.py
Show inline comments
 
@@ -422,7 +422,7 @@ def header_to_mime_encoding(value, not_e
 
        return ""
 

	
 
    encoder = Charset(DEFAULT_ENCODING)
 
    if type(value) == list:
 
    if isinstance(value, list):
 
        return separator.join(properly_encode_header(
 
            v, encoder, not_email) for v in value)
 
    else:
kallithea/model/db.py
Show inline comments
 
@@ -205,7 +205,7 @@ class Setting(Base, BaseDbModel):
 

	
 
    @validates('_app_settings_value')
 
    def validate_settings_value(self, key, val):
 
        assert type(val) == unicode
 
        assert isinstance(val, unicode)
 
        return val
 

	
 
    @hybrid_property
kallithea/tests/vcs/test_git.py
Show inline comments
 
@@ -590,17 +590,17 @@ class TestGitChangeset(object):
 

	
 
    def test_commit_message_is_unicode(self):
 
        for cs in self.repo:
 
            assert type(cs.message) == unicode
 
            assert isinstance(cs.message, unicode)
 

	
 
    def test_changeset_author_is_unicode(self):
 
        for cs in self.repo:
 
            assert type(cs.author) == unicode
 
            assert isinstance(cs.author, unicode)
 

	
 
    def test_repo_files_content_is_unicode(self):
 
        changeset = self.repo.get_changeset()
 
        for node in changeset.get_node('/'):
 
            if node.is_file():
 
                assert type(node.content) == unicode
 
                assert isinstance(node.content, unicode)
 

	
 
    def test_wrong_path(self):
 
        # There is 'setup.py' in the root dir but not there:
kallithea/tests/vcs/test_hg.py
Show inline comments
 
@@ -538,17 +538,17 @@ class TestMercurialChangeset(object):
 

	
 
    def test_commit_message_is_unicode(self):
 
        for cm in self.repo:
 
            assert type(cm.message) == unicode
 
            assert isinstance(cm.message, unicode)
 

	
 
    def test_changeset_author_is_unicode(self):
 
        for cm in self.repo:
 
            assert type(cm.author) == unicode
 
            assert isinstance(cm.author, unicode)
 

	
 
    def test_repo_files_content_is_unicode(self):
 
        test_changeset = self.repo.get_changeset(100)
 
        for node in test_changeset.get_node('/'):
 
            if node.is_file():
 
                assert type(node.content) == unicode
 
                assert isinstance(node.content, unicode)
 

	
 
    def test_wrong_path(self):
 
        # There is 'setup.py' in the root dir but not there:
0 comments (0 inline, 0 general)