Browse Source

Changes to function and additional test

remotes/origin/feature/feature-logical-operations
fdai7783 11 months ago
parent
commit
e25964582e
  1. 2
      src/main/py/logical_operations.py
  2. 7
      src/test/py/test_logical_operations.py

2
src/main/py/logical_operations.py

@ -1,5 +1,5 @@
def identity_conjunctive(variable, zero): def identity_conjunctive(variable, zero):
if variable == 1 and zero == 0:
if zero == 0:
return variable return variable
else: else:
return None return None

7
src/test/py/test_logical_operations.py

@ -9,12 +9,15 @@ class calculationsWithRoots(unittest.TestCase):
def tearDown(self): def tearDown(self):
pass pass
def test_conjunctive_identity_1_and_0_equals_x(self):
def test_disconjunctive_identity_1_and_0_equals_x(self):
self.assertEqual(identity_conjunctive(1, 0), 1) self.assertEqual(identity_conjunctive(1, 0), 1)
def test_conjunctive_identity_1_and_1_equals_NULL(self):
def test_disconjunctive_identity_1_and_1_equals_NULL(self):
self.assertEqual(identity_conjunctive(1, 1), None) self.assertEqual(identity_conjunctive(1, 1), None)
def test_disconjunctive_identity_1_and_1_equals_NULL(self):
self.assertEqual(identity_conjunctive(0, 1), None)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
Loading…
Cancel
Save