##// END OF EJS Templates
cleanup: use isinstance instead of comparing types...
Mads Kiilerich -
r7884:280c8767 default
parent child Browse files
Show More
@@ -422,7 +422,7 b' def header_to_mime_encoding(value, not_e'
422 return ""
422 return ""
423
423
424 encoder = Charset(DEFAULT_ENCODING)
424 encoder = Charset(DEFAULT_ENCODING)
425 if type(value) == list:
425 if isinstance(value, list):
426 return separator.join(properly_encode_header(
426 return separator.join(properly_encode_header(
427 v, encoder, not_email) for v in value)
427 v, encoder, not_email) for v in value)
428 else:
428 else:
@@ -205,7 +205,7 b' class Setting(Base, BaseDbModel):'
205
205
206 @validates('_app_settings_value')
206 @validates('_app_settings_value')
207 def validate_settings_value(self, key, val):
207 def validate_settings_value(self, key, val):
208 assert type(val) == unicode
208 assert isinstance(val, unicode)
209 return val
209 return val
210
210
211 @hybrid_property
211 @hybrid_property
@@ -590,17 +590,17 b' class TestGitChangeset(object):'
590
590
591 def test_commit_message_is_unicode(self):
591 def test_commit_message_is_unicode(self):
592 for cs in self.repo:
592 for cs in self.repo:
593 assert type(cs.message) == unicode
593 assert isinstance(cs.message, unicode)
594
594
595 def test_changeset_author_is_unicode(self):
595 def test_changeset_author_is_unicode(self):
596 for cs in self.repo:
596 for cs in self.repo:
597 assert type(cs.author) == unicode
597 assert isinstance(cs.author, unicode)
598
598
599 def test_repo_files_content_is_unicode(self):
599 def test_repo_files_content_is_unicode(self):
600 changeset = self.repo.get_changeset()
600 changeset = self.repo.get_changeset()
601 for node in changeset.get_node('/'):
601 for node in changeset.get_node('/'):
602 if node.is_file():
602 if node.is_file():
603 assert type(node.content) == unicode
603 assert isinstance(node.content, unicode)
604
604
605 def test_wrong_path(self):
605 def test_wrong_path(self):
606 # There is 'setup.py' in the root dir but not there:
606 # There is 'setup.py' in the root dir but not there:
@@ -538,17 +538,17 b' class TestMercurialChangeset(object):'
538
538
539 def test_commit_message_is_unicode(self):
539 def test_commit_message_is_unicode(self):
540 for cm in self.repo:
540 for cm in self.repo:
541 assert type(cm.message) == unicode
541 assert isinstance(cm.message, unicode)
542
542
543 def test_changeset_author_is_unicode(self):
543 def test_changeset_author_is_unicode(self):
544 for cm in self.repo:
544 for cm in self.repo:
545 assert type(cm.author) == unicode
545 assert isinstance(cm.author, unicode)
546
546
547 def test_repo_files_content_is_unicode(self):
547 def test_repo_files_content_is_unicode(self):
548 test_changeset = self.repo.get_changeset(100)
548 test_changeset = self.repo.get_changeset(100)
549 for node in test_changeset.get_node('/'):
549 for node in test_changeset.get_node('/'):
550 if node.is_file():
550 if node.is_file():
551 assert type(node.content) == unicode
551 assert isinstance(node.content, unicode)
552
552
553 def test_wrong_path(self):
553 def test_wrong_path(self):
554 # There is 'setup.py' in the root dir but not there:
554 # There is 'setup.py' in the root dir but not there:
General Comments 0
You need to be logged in to leave comments. Login now