Esempio n. 1
0
    def test_super_class_multiple(self):
        class A:
            pass

        class B:
            pass

        class C(A, B):
            pass

        assert super_class(C) == A
        assert super_class(A) == object
        assert super_class(B) == object
Esempio n. 2
0
    def test_super_class_multiple(self):

        class A:
            pass

        class B:
            pass

        class C(A, B):
            pass

        assert super_class(C) == A
        assert super_class(A) == object
        assert super_class(B) == object
Esempio n. 3
0
    def ordered_field_names(cls):
        """The ordered list of field names.

        This is a metamethod which should be called on cls.

        Returns:
            An tuple containing the field names in order.
        """
        if cls is Header:
            return cls._ordered_field_names
        return super_class(cls).ordered_field_names() + cls._ordered_field_names
Esempio n. 4
0
    def ordered_field_names(cls):
        """The ordered list of field names.

        This is a metamethod which should be called on cls.

        Returns:
            An tuple containing the field names in order.
        """

        if cls is Header:
            return cls._ordered_field_names
        return super_class(cls).ordered_field_names() + cls._ordered_field_names
Esempio n. 5
0
 def test_super_class_single(self):
     assert super_class(object) == object
Esempio n. 6
0
 def test_super_class_single(self):
     assert super_class(object) == object