def test_distinct_imports_separtes_lists(self): """A successful case for distinct_imports()""" imports, aliases = distinct_imports('hello', [ TaskDeclaration(TaskForTesting()), TaskAliasDeclaration(':hello', [':test']) ]) self.assertTrue(isinstance(imports[0], TaskDeclaration)) self.assertTrue(isinstance(aliases[0], TaskAliasDeclaration))
def test_distinct_imports_does_not_raise_any_exception_when_no_data(self): self.assertEqual(([], []), distinct_imports('hello', []))
def test_distinct_imports_raises_exception_when_unknown_type_object_added_to_list( self): self.assertRaises( ContextException, lambda: distinct_imports( 'hello', ['string-should-not-be-there-even-IDE-knows-that']))