CORD-1570: Several bug fixes, expanded unit tests for security refactoring
Change-Id: Ied8dca916d3c22a252f6de38a65ef1b20c9d639d
diff --git a/lib/xos-genx/tests/xos_validation_test.py b/lib/xos-genx/tests/xos_validation_test.py
index 20ba5da..7e70ede 100644
--- a/lib/xos-genx/tests/xos_validation_test.py
+++ b/lib/xos-genx/tests/xos_validation_test.py
@@ -76,35 +76,6 @@
with self.assertRaises(Exception):
policy_output_validator(obj, {})
- def test_equal(self):
- xproto = \
-"""
- policy test_policy < not (ctx.user = obj.user) >
-"""
-
- args = FakeArgs()
- args.inputs = xproto
- args.target = self.target
-
- output = XOSGenerator.generate(args)
-
- exec(output) # This loads the generated function, which should look like this:
-
- """
- def policy_output_validator(obj, ctx):
- i2 = (ctx.user == obj.user)
- i1 = (not i2)
- if (not i1):
- raise Exception('Necessary Failure')
- """
-
- obj = FakeArgs()
- obj.user = 1
- ctx = FakeArgs()
- ctx.user = 1
-
- with self.assertRaises(Exception):
- policy_output_validator(obj, ctx)
def test_equal(self):
xproto = \
@@ -139,7 +110,7 @@
def test_bin(self):
xproto = \
"""
- policy test_policy < (ctx.is_admin = True | obj.empty = True) & False>
+ policy test_policy < not (ctx.is_admin = True | obj.empty = True) | False>
"""
args = FakeArgs()