예제 #1
0
    def test_something_with_one_definition(self):
        output = flatten(SomethingWithOneDefinition)
        self.assertEqual(output, """\
class SomethingWithOneDefinition(object):
    def get_name(self):
        return 'foo'
""")
예제 #2
0
    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
""")
예제 #4
0
    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'
""")
예제 #5
0
    def test_complex(self):
        output = flatten(ComplexExtension)
        self.assertEqual(
            output, """\
class ComplexExtension(object):
    def methodA(self):
        pass

    def methodB(self):
        pass
""")
예제 #6
0
    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
""")
예제 #8
0
    def test_simple(self):
        output = flatten(Simple)
        self.assertEqual(output, """\
class Simple(object):
    pass
""")