|
4 | 4 | class OperatorTests(unittest.TestCase): |
5 | 5 |
|
6 | 6 | def test_and_operator(self): |
7 | | - obj=Operation([True,"AND",False,"out"]) |
| 7 | + obj=Operation([True,False],"AND","out") |
8 | 8 | self.assertFalse(obj(), "The sum is wrong.") |
9 | | - obj=Operation([True,"AND",True,"out"]) |
| 9 | + obj=Operation([True,True],"AND","out") |
10 | 10 | self.assertTrue(obj(), "The sum is wrong.") |
11 | 11 |
|
12 | 12 | def test_or_operator(self): |
13 | | - obj=Operation([False,"OR",False,"out"]) |
| 13 | + obj=Operation([False,False],"OR","out") |
14 | 14 | self.assertFalse(obj(), "False and False should be False") |
15 | | - obj=Operation([True,"OR",False,"out"]) |
| 15 | + obj=Operation([True,False],"OR","out") |
16 | 16 | self.assertTrue(obj(), "True | False = True") |
17 | | - obj=Operation([True,"OR",True,"out"]) |
| 17 | + obj=Operation([True,True],"OR","out") |
18 | 18 | self.assertTrue(obj(), "The sum is wrong.") |
19 | 19 |
|
20 | 20 | def test_xor_operator(self): |
21 | | - obj=Operation([False,"XOR",False,"out"]) |
| 21 | + obj=Operation([False,False],"XOR","out") |
22 | 22 | self.assertFalse(obj(), "False ^ False should be False") |
23 | | - obj=Operation([True,"XOR",False,"out"]) |
| 23 | + obj=Operation([True,False],"XOR","out") |
24 | 24 | self.assertTrue(obj(), "True ^ False = True") |
25 | | - obj=Operation([True,"XOR",True,"out"]) |
| 25 | + obj=Operation([True,True],"XOR","out") |
26 | 26 | self.assertFalse(obj(), "True ^ True should be False") |
27 | 27 | def test_call_operator(self): |
28 | | - obj=Operation([False,"OR",False,"out"]) |
| 28 | + obj=Operation([False,False],"OR","out") |
29 | 29 | self.assertFalse(True&obj(), "True & False should be True") |
30 | | - obj=Operation([False,"OR",False,"out"]) |
| 30 | + obj=Operation([False,False],"OR","out") |
31 | 31 | self.assertFalse(False|obj(), "True | False should be True") |
32 | | - obj=Operation([False,"OR",False,"out"]) |
| 32 | + obj=Operation([False,False],"OR","out") |
33 | 33 | self.assertFalse(False^obj(), "True ^ False should be True") |
34 | 34 |
|
35 | 35 |
|
|
0 commit comments