def test_something_with_one_definition(self): output = flatten(SomethingWithOneDefinition) self.assertEqual(output, """\ class SomethingWithOneDefinition(object): def get_name(self): return 'foo' """)
def test_simple_metaclass_definition(self): output = flatten(Simple) self.assertEqual(output, """\ class SimpleMeta(type): pass class Simple(metaclass=SimpleMeta): pass """)
def test_complex(self): output = flatten(ComplexExtension) self.assertEqual(output, """\ class ComplexExtension(object): def methodA(self): pass def methodB(self): pass """)
def test_something_with_two_definitions(self): output = flatten(SomethingWithTwoDefinitions) self.assertEqual(output, """\ class SomethingWithTwoDefinitions(object): def get_name(self): return 'foo' def get_second(self): return 'bar' """)
def test_complex(self): output = flatten(ComplexExtension) self.assertEqual( output, """\ class ComplexExtension(object): def methodA(self): pass def methodB(self): pass """)
def test_simple_metaclass_definition(self): output = flatten(Simple) self.assertEqual( output, """\ class SimpleMeta(type): pass class Simple(metaclass=SimpleMeta): pass """)
def test_simple(self): output = flatten(SimpleExtension) self.assertEqual(output, """\ class SimpleExtension(object): pass """)
def test_simple(self): output = flatten(Simple) self.assertEqual(output, """\ class Simple(object): pass """)