Back to index

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

List of all members.

Public Member Functions

def setUp
def test_binopsVsSubsets
def test_commutativity
def test_summations
def test_exclusion

Public Attributes

 a
 b

Detailed Description

Definition at line 1502 of file test_set.py.


Member Function Documentation

Definition at line 1503 of file test_set.py.

01503 
01504     def setUp(self):
01505         self.a = set('abracadabra')
01506         self.b = set('alacazam')

Here is the caller graph for this function:

Definition at line 1507 of file test_set.py.

01507 
01508     def test_binopsVsSubsets(self):
01509         a, b = self.a, self.b
01510         self.assertTrue(a - b < a)
01511         self.assertTrue(b - a < b)
01512         self.assertTrue(a & b < a)
01513         self.assertTrue(a & b < b)
01514         self.assertTrue(a | b > a)
01515         self.assertTrue(a | b > b)
01516         self.assertTrue(a ^ b < a | b)

Here is the call graph for this function:

Definition at line 1517 of file test_set.py.

01517 
01518     def test_commutativity(self):
01519         a, b = self.a, self.b
01520         self.assertEqual(a&b, b&a)
01521         self.assertEqual(a|b, b|a)
01522         self.assertEqual(a^b, b^a)
01523         if a != b:
01524             self.assertNotEqual(a-b, b-a)

Here is the call graph for this function:

Definition at line 1536 of file test_set.py.

01536 
01537     def test_exclusion(self):
01538         # check that inverse operations show non-overlap
01539         a, b, zero = self.a, self.b, set()
01540         self.assertEqual((a-b)&b, zero)
01541         self.assertEqual((b-a)&a, zero)
01542         self.assertEqual((a&b)&(a^b), zero)
01543 
01544 # Tests derived from test_itertools.py =======================================

Here is the call graph for this function:

Definition at line 1525 of file test_set.py.

01525 
01526     def test_summations(self):
01527         # check that sums of parts equal the whole
01528         a, b = self.a, self.b
01529         self.assertEqual((a-b)|(a&b)|(b-a), a|b)
01530         self.assertEqual((a&b)|(a^b), a|b)
01531         self.assertEqual(a|(b-a), a|b)
01532         self.assertEqual((a-b)|b, a|b)
01533         self.assertEqual((a-b)|(a&b), a)
01534         self.assertEqual((b-a)|(a&b), b)
01535         self.assertEqual((a-b)|(b-a), a^b)

Here is the call graph for this function:


Member Data Documentation

Definition at line 1504 of file test_set.py.

Definition at line 1505 of file test_set.py.


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