示例#1
0
文件: test_util.py 项目: yzchs7/segpy
    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
示例#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
示例#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
示例#4
0
文件: header.py 项目: wassname/segpy
    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
示例#5
0
文件: test_util.py 项目: yzchs7/segpy
 def test_super_class_single(self):
     assert super_class(object) == object
示例#6
0
 def test_super_class_single(self):
     assert super_class(object) == object