Beispiel #1
0
def test_tuple_equal():
    yield ok, tuple_equal((1, ), (1, ))
    yield ok, tuple_equal((1, [1]), (1, [1]))
    yield ok, not tuple_equal((1, ), ([1], ))
    yield ok, not tuple_equal(([1], ), ([1], [1]))
    yield ok, tuple_equal(([1], ), ([1], ))
    yield ok, not tuple_equal(([1], ), ([2], ))
    yield ok, not tuple_equal(([1], [1, 2]), ([1, 2], [1, 2]))
    yield ok, not tuple_equal(([1], [1, 2]), ([1], [1, 3]))
Beispiel #2
0
def test_tuple_equal():
    assert tuple_equal((1, ), (1, ))
    assert tuple_equal((1, [1]), (1, [1]))
    assert not tuple_equal((1, ), ([1], ))
    assert not tuple_equal(([1], ), ([1], [1]))
    assert tuple_equal(([1], ), ([1], ))
    assert not tuple_equal(([1], ), ([2], ))
    assert not tuple_equal(([1], [1, 2]), ([1, 2], [1, 2]))
    assert not tuple_equal(([1], [1, 2]), ([1], [1, 3]))
Beispiel #3
0
 def __eq__(self, other):
     return self[0] == other[0] and \
            tuple_equal(expand(self.fs), expand(other.fs))
Beispiel #4
0
 def __eq__(self, other):
     return tuple_equal(expand(self.fs), expand(other.fs))