Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_set.TestMutate Class Reference

List of all members.

Public Member Functions

def setUp
def test_add_present
def test_add_absent
def test_add_until_full
def test_remove_present
def test_remove_absent
def test_remove_until_empty
def test_discard_present
def test_discard_absent
def test_clear
def test_pop
def test_update_empty_tuple
def test_update_unit_tuple_overlap
def test_update_unit_tuple_non_overlap

Public Attributes

 values
 set

Detailed Description

Definition at line 1132 of file test_set.py.


Member Function Documentation

Definition at line 1133 of file test_set.py.

01133 
01134     def setUp(self):
01135         self.values = ["a", "b", "c"]
01136         self.set = set(self.values)

Here is the caller graph for this function:

Definition at line 1141 of file test_set.py.

01141 
01142     def test_add_absent(self):
01143         self.set.add("d")
01144         self.assertEqual(self.set, set("abcd"))

Here is the call graph for this function:

Definition at line 1137 of file test_set.py.

01137 
01138     def test_add_present(self):
01139         self.set.add("c")
01140         self.assertEqual(self.set, set("abc"))

Here is the call graph for this function:

Definition at line 1145 of file test_set.py.

01145 
01146     def test_add_until_full(self):
01147         tmp = set()
01148         expected_len = 0
01149         for v in self.values:
01150             tmp.add(v)
01151             expected_len += 1
01152             self.assertEqual(len(tmp), expected_len)
01153         self.assertEqual(tmp, self.set)

Here is the call graph for this function:

Definition at line 1180 of file test_set.py.

01180 
01181     def test_clear(self):
01182         self.set.clear()
01183         self.assertEqual(len(self.set), 0)

Here is the call graph for this function:

Definition at line 1176 of file test_set.py.

01176 
01177     def test_discard_absent(self):
01178         self.set.discard("d")
01179         self.assertEqual(self.set, set("abc"))

Here is the call graph for this function:

Definition at line 1172 of file test_set.py.

01172 
01173     def test_discard_present(self):
01174         self.set.discard("c")
01175         self.assertEqual(self.set, set("ab"))

Here is the call graph for this function:

Definition at line 1184 of file test_set.py.

01184 
01185     def test_pop(self):
01186         popped = {}
01187         while self.set:
01188             popped[self.set.pop()] = None
01189         self.assertEqual(len(popped), len(self.values))
01190         for v in self.values:
01191             self.assertIn(v, popped)

Here is the call graph for this function:

Definition at line 1158 of file test_set.py.

01158 
01159     def test_remove_absent(self):
01160         try:
01161             self.set.remove("d")
01162             self.fail("Removing missing element should have raised LookupError")
01163         except LookupError:
01164             pass

Here is the call graph for this function:

Definition at line 1154 of file test_set.py.

01154 
01155     def test_remove_present(self):
01156         self.set.remove("b")
01157         self.assertEqual(self.set, set("ac"))

Here is the call graph for this function:

Definition at line 1165 of file test_set.py.

01165 
01166     def test_remove_until_empty(self):
01167         expected_len = len(self.set)
01168         for v in self.values:
01169             self.set.remove(v)
01170             expected_len -= 1
01171             self.assertEqual(len(self.set), expected_len)

Here is the call graph for this function:

Definition at line 1192 of file test_set.py.

01192 
01193     def test_update_empty_tuple(self):
01194         self.set.update(())
01195         self.assertEqual(self.set, set(self.values))

Here is the call graph for this function:

Definition at line 1200 of file test_set.py.

01200 
01201     def test_update_unit_tuple_non_overlap(self):
01202         self.set.update(("a", "z"))
01203         self.assertEqual(self.set, set(self.values + ["z"]))
01204 
01205 #==============================================================================

Here is the call graph for this function:

Definition at line 1196 of file test_set.py.

01196 
01197     def test_update_unit_tuple_overlap(self):
01198         self.set.update(("a",))
01199         self.assertEqual(self.set, set(self.values))

Here is the call graph for this function:


Member Data Documentation

Definition at line 1135 of file test_set.py.

Definition at line 1134 of file test_set.py.


The documentation for this class was generated from the following file: