Browse Source

Added another testcase

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

2
src/main/py/logical_operations.py

@ -6,7 +6,7 @@ def identity_disconjunctive(variable, operator, zero):
def identity_conjunctive(variable, operator, zero):
if zero == 0 and operator == "+":
if zero == 1 and operator == ".":
return variable
else:
return None

3
src/test/py/test_logical_operations.py

@ -27,6 +27,9 @@ class calculationsWithRoots(unittest.TestCase):
def test_conjunctive_identity_1_and_0_equals_None(self):
self.assertEqual(identity_conjunctive(1, ".", 0), None)
def test_conjunctive_identity_1_and_0_equals_None(self):
self.assertEqual(identity_conjunctive(0, ".", 1), 0)
if __name__ == "__main__":
unittest.main()
Loading…
Cancel
Save