def test_iter(self): s = mySet([1, 2, 3]) l = [] for i in s: l.append(i) self.assertEqual(l, [1, 2, 3])
def test_eq(self): s1 = mySet([1, 2, 3]) s2 = mySet([1, 2, 3]) self.assertEqual(s1, s2)
def test_difference(self): s1 = mySet([1, 2, 3, 4]) s2 = mySet([1, 3]) s = s1.difference(s2) self.assertEqual(s, mySet([2, 4]))
def test_initempty(self): s = mySet() self.assert_(isinstance(s, mrepo.mySet))
def test_init(self): s = mySet([1, 2, 3, 4]) self.assert_(isinstance(s, mrepo.mySet)) self.assert_(repr(s) == 'mySet([1, 2, 3, 4])')
def setUp(self): self.s = mySet([1, 2, 3, 4])
def test_difference(self): s1 = mySet([ 1, 2, 3, 4 ]) s2 = mySet([ 1, 3 ]) s = s1.difference(s2) self.assertEqual(s, mySet([2, 4]))
def test_init(self): s = mySet([ 1, 2, 3, 4 ]) self.assert_(isinstance(s, mrepo.mySet)) self.assert_(repr(s) == 'mySet([1, 2, 3, 4])')