Simplified code building sets of characters.

This commit is contained in:
Tim Peters 2002-08-25 17:40:29 +00:00
parent a777799040
commit de830ca4eb
1 changed files with 5 additions and 5 deletions

View File

@ -292,11 +292,11 @@ class TestMutate(unittest.TestCase):
def test_add_present(self): def test_add_present(self):
self.set.add("c") self.set.add("c")
self.assertEqual(self.set, Set(("a", "b", "c"))) self.assertEqual(self.set, Set("abc"))
def test_add_absent(self): def test_add_absent(self):
self.set.add("d") self.set.add("d")
self.assertEqual(self.set, Set(("a", "b", "c", "d"))) self.assertEqual(self.set, Set("abcd"))
def test_add_until_full(self): def test_add_until_full(self):
tmp = Set() tmp = Set()
@ -309,7 +309,7 @@ class TestMutate(unittest.TestCase):
def test_remove_present(self): def test_remove_present(self):
self.set.remove("b") self.set.remove("b")
self.assertEqual(self.set, Set(("a", "c"))) self.assertEqual(self.set, Set("ac"))
def test_remove_absent(self): def test_remove_absent(self):
try: try:
@ -327,11 +327,11 @@ class TestMutate(unittest.TestCase):
def test_discard_present(self): def test_discard_present(self):
self.set.discard("c") self.set.discard("c")
self.assertEqual(self.set, Set(("a", "b"))) self.assertEqual(self.set, Set("ab"))
def test_discard_absent(self): def test_discard_absent(self):
self.set.discard("d") self.set.discard("d")
self.assertEqual(self.set, Set(("a", "b", "c"))) self.assertEqual(self.set, Set("abc"))
def test_clear(self): def test_clear(self):
self.set.clear() self.set.clear()