예제 #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
파일: test_util.py 프로젝트: abingham/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
예제 #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
파일: test_util.py 프로젝트: abingham/segpy
 def test_super_class_single(self):
     assert super_class(object) == object