Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_set.TestOnlySetsDict Class Reference
Inheritance diagram for test.test_set.TestOnlySetsDict:
Inheritance graph
[legend]
Collaboration diagram for test.test_set.TestOnlySetsDict:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_eq_ne
def test_ge_gt_le_lt
def test_update_operator
def test_update
def test_union
def test_intersection_update_operator
def test_intersection_update
def test_intersection
def test_sym_difference_update_operator
def test_sym_difference_update
def test_sym_difference
def test_difference_update_operator
def test_difference_update
def test_difference

Public Attributes

 set
 other
 otherIsIterable

Detailed Description

Definition at line 1408 of file test_set.py.


Member Function Documentation

Definition at line 1409 of file test_set.py.

01409 
01410     def setUp(self):
01411         self.set   = set((1, 2, 3))
01412         self.other = {1:2, 3:4}
01413         self.otherIsIterable = True
01414 
01415 #------------------------------------------------------------------------------

Here is the caller graph for this function:

Definition at line 1390 of file test_set.py.

01390 
01391     def test_difference(self):
01392         self.assertRaises(TypeError, lambda: self.set - self.other)
01393         self.assertRaises(TypeError, lambda: self.other - self.set)
01394         if self.otherIsIterable:
01395             self.set.difference(self.other)
01396         else:
01397             self.assertRaises(TypeError, self.set.difference, self.other)
01398 
01399 #------------------------------------------------------------------------------

Here is the call graph for this function:

Definition at line 1382 of file test_set.py.

01382 
01383     def test_difference_update(self):
01384         if self.otherIsIterable:
01385             self.set.difference_update(self.other)
01386         else:
01387             self.assertRaises(TypeError,
01388                               self.set.difference_update,
01389                               self.other)

Here is the call graph for this function:

Definition at line 1374 of file test_set.py.

01374 
01375     def test_difference_update_operator(self):
01376         try:
01377             self.set -= self.other
01378         except TypeError:
01379             pass
01380         else:
01381             self.fail("expected TypeError")

Here is the call graph for this function:

Definition at line 1286 of file test_set.py.

01286 
01287     def test_eq_ne(self):
01288         # Unlike the others, this is testing that == and != *are* allowed.
01289         self.assertEqual(self.other == self.set, False)
01290         self.assertEqual(self.set == self.other, False)
01291         self.assertEqual(self.other != self.set, True)
01292         self.assertEqual(self.set != self.other, True)

Definition at line 1293 of file test_set.py.

01293 
01294     def test_ge_gt_le_lt(self):
01295         self.assertRaises(TypeError, lambda: self.set < self.other)
01296         self.assertRaises(TypeError, lambda: self.set <= self.other)
01297         self.assertRaises(TypeError, lambda: self.set > self.other)
01298         self.assertRaises(TypeError, lambda: self.set >= self.other)
01299 
01300         self.assertRaises(TypeError, lambda: self.other < self.set)
01301         self.assertRaises(TypeError, lambda: self.other <= self.set)
01302         self.assertRaises(TypeError, lambda: self.other > self.set)
01303         self.assertRaises(TypeError, lambda: self.other >= self.set)

Here is the call graph for this function:

Definition at line 1342 of file test_set.py.

01342 
01343     def test_intersection(self):
01344         self.assertRaises(TypeError, lambda: self.set & self.other)
01345         self.assertRaises(TypeError, lambda: self.other & self.set)
01346         if self.otherIsIterable:
01347             self.set.intersection(self.other)
01348         else:
01349             self.assertRaises(TypeError, self.set.intersection, self.other)

Here is the call graph for this function:

Definition at line 1334 of file test_set.py.

01334 
01335     def test_intersection_update(self):
01336         if self.otherIsIterable:
01337             self.set.intersection_update(self.other)
01338         else:
01339             self.assertRaises(TypeError,
01340                               self.set.intersection_update,
01341                               self.other)

Here is the call graph for this function:

Definition at line 1326 of file test_set.py.

01326 
01327     def test_intersection_update_operator(self):
01328         try:
01329             self.set &= self.other
01330         except TypeError:
01331             pass
01332         else:
01333             self.fail("expected TypeError")

Here is the call graph for this function:

Definition at line 1366 of file test_set.py.

01366 
01367     def test_sym_difference(self):
01368         self.assertRaises(TypeError, lambda: self.set ^ self.other)
01369         self.assertRaises(TypeError, lambda: self.other ^ self.set)
01370         if self.otherIsIterable:
01371             self.set.symmetric_difference(self.other)
01372         else:
01373             self.assertRaises(TypeError, self.set.symmetric_difference, self.other)

Here is the call graph for this function:

Definition at line 1358 of file test_set.py.

01358 
01359     def test_sym_difference_update(self):
01360         if self.otherIsIterable:
01361             self.set.symmetric_difference_update(self.other)
01362         else:
01363             self.assertRaises(TypeError,
01364                               self.set.symmetric_difference_update,
01365                               self.other)

Here is the call graph for this function:

Definition at line 1350 of file test_set.py.

01350 
01351     def test_sym_difference_update_operator(self):
01352         try:
01353             self.set ^= self.other
01354         except TypeError:
01355             pass
01356         else:
01357             self.fail("expected TypeError")

Here is the call graph for this function:

Definition at line 1318 of file test_set.py.

01318 
01319     def test_union(self):
01320         self.assertRaises(TypeError, lambda: self.set | self.other)
01321         self.assertRaises(TypeError, lambda: self.other | self.set)
01322         if self.otherIsIterable:
01323             self.set.union(self.other)
01324         else:
01325             self.assertRaises(TypeError, self.set.union, self.other)

Here is the call graph for this function:

Definition at line 1312 of file test_set.py.

01312 
01313     def test_update(self):
01314         if self.otherIsIterable:
01315             self.set.update(self.other)
01316         else:
01317             self.assertRaises(TypeError, self.set.update, self.other)

Here is the call graph for this function:

Definition at line 1304 of file test_set.py.

01304 
01305     def test_update_operator(self):
01306         try:
01307             self.set |= self.other
01308         except TypeError:
01309             pass
01310         else:
01311             self.fail("expected TypeError")

Here is the call graph for this function:


Member Data Documentation

Reimplemented from test.test_set.TestOnlySetsInBinaryOps.

Definition at line 1411 of file test_set.py.

Definition at line 1412 of file test_set.py.

Reimplemented from test.test_set.TestOnlySetsInBinaryOps.

Definition at line 1410 of file test_set.py.


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