2 if sys
.path
[0] != "../..":
3 sys
.path
.insert(0, "../..")
14 class A2(exclusiveattr
): pass
15 class B2(exclusiveattr
): pass
16 class C2(exclusiveattr
): pass
18 class A3(sortbeforeattr
): pass
19 class B3(sortbeforeattr
): pass
22 class A4(sortbeforeexclusiveattr
): pass
23 class B4(sortbeforeexclusiveattr
): pass
27 class AttrTestCase(unittest
.TestCase
):
30 checkattrs([A1(), B1(), A1()], [A1
, B1
])
31 self
.assertRaises(TypeError, checkattrs
, [A1(), B1(), A1()], [A1
, C1
])
40 self
.assertEqual(mergeattrs([a1
, b2
, b1
, c2
, a2
, c1
]), [a1
, b2
, b1
, c2
, a2
, c1
])
42 def testExclusive(self
):
49 self
.assertEqual(mergeattrs([a1
, b2
, b1
, c2
, a2
, c1
]), [b1
, a2
, c1
])
58 self
.assertEqual(mergeattrs([a1
, b2
, b1
, c2
, a2
, c1
]), [a1
, a2
, b2
, b1
, c2
, c1
])
60 def testExclusiveSort(self
):
67 self
.assertEqual(mergeattrs([b2
, a1
, b1
, c2
, a2
, c1
]), [a2
, b1
, c2
, c1
])
70 if __name__
== "__main__":