예제 #1
0
    def test_tuple(self):
        u"""Test indexed tuple"""
        i = patchdir.IndexedTuple((1, 2, 3), (u"a", u"b"))
        i2 = patchdir.IndexedTuple((), (u"hello", u"there", u"how are you"))

        assert i[0] == u"a"
        assert i[1] == u"b"
        assert i2[1] == u"there"
        assert len(i) == 2 and len(i2) == 3
        assert i2 < i, i2 < i
예제 #2
0
 def test_tuple_assignment(self):
     a, b, c = patchdir.IndexedTuple((), (1, 2, 3))
     assert a == 1
     assert b == 2
     assert c == 3