Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_obey_support_with_high_tolerance(self):
"""Test for obey support"""
A = np.array([[2, 1], [0, 2]])
B = np.array([[2, 0], [1, 2]])
tol = 1
self.assertFalse(obey_support(False, np.array([0, 1])))
self.assertFalse(
obey_support(np.array([1, 0]), np.array([0, 1]), tol=tol)
)
self.assertFalse(obey_support(np.array([1, 0]), np.array([0]), tol=tol))
self.assertFalse(
obey_support(np.array([0, 0.5]), np.array([1]), tol=tol)
)
self.assertFalse(
obey_support(np.array([0.5, 0]), np.array([0]), tol=tol)
)
self.assertFalse(
obey_support(np.array([0.5, 0.5]), np.array([0, 1]), tol=tol)
)
def test_obey_support(self):
"""Test for obey support"""
A = np.array([[2, 1], [0, 2]])
B = np.array([[2, 0], [1, 2]])
self.assertFalse(obey_support(False, np.array([0, 1])))
self.assertFalse(obey_support(np.array([1, 0]), np.array([0, 1])))
self.assertFalse(obey_support(np.array([0, 0.5]), np.array([0])))
self.assertFalse(obey_support(np.array([0.5, 0]), np.array([1])))
self.assertTrue(obey_support(np.array([1, 0]), np.array([0])))
self.assertTrue(obey_support(np.array([0, 0.5]), np.array([1])))
self.assertTrue(obey_support(np.array([0.5, 0]), np.array([0])))
self.assertTrue(obey_support(np.array([0.5, 0.5]), np.array([0, 1])))
def test_obey_support_with_high_tolerance(self):
"""Test for obey support"""
A = np.array([[2, 1], [0, 2]])
B = np.array([[2, 0], [1, 2]])
tol = 1
self.assertFalse(obey_support(False, np.array([0, 1])))
self.assertFalse(
obey_support(np.array([1, 0]), np.array([0, 1]), tol=tol)
)
self.assertFalse(obey_support(np.array([1, 0]), np.array([0]), tol=tol))
self.assertFalse(
obey_support(np.array([0, 0.5]), np.array([1]), tol=tol)
)
self.assertFalse(
obey_support(np.array([0.5, 0]), np.array([0]), tol=tol)
)
self.assertFalse(
obey_support(np.array([0.5, 0.5]), np.array([0, 1]), tol=tol)
)
def test_obey_support(self):
"""Test for obey support"""
A = np.array([[2, 1], [0, 2]])
B = np.array([[2, 0], [1, 2]])
self.assertFalse(obey_support(False, np.array([0, 1])))
self.assertFalse(obey_support(np.array([1, 0]), np.array([0, 1])))
self.assertFalse(obey_support(np.array([0, 0.5]), np.array([0])))
self.assertFalse(obey_support(np.array([0.5, 0]), np.array([1])))
self.assertTrue(obey_support(np.array([1, 0]), np.array([0])))
self.assertTrue(obey_support(np.array([0, 0.5]), np.array([1])))
self.assertTrue(obey_support(np.array([0.5, 0]), np.array([0])))
self.assertTrue(obey_support(np.array([0.5, 0.5]), np.array([0, 1])))
def test_obey_support(self):
"""Test for obey support"""
A = np.array([[2, 1], [0, 2]])
B = np.array([[2, 0], [1, 2]])
self.assertFalse(obey_support(False, np.array([0, 1])))
self.assertFalse(obey_support(np.array([1, 0]), np.array([0, 1])))
self.assertFalse(obey_support(np.array([0, 0.5]), np.array([0])))
self.assertFalse(obey_support(np.array([0.5, 0]), np.array([1])))
self.assertTrue(obey_support(np.array([1, 0]), np.array([0])))
self.assertTrue(obey_support(np.array([0, 0.5]), np.array([1])))
self.assertTrue(obey_support(np.array([0.5, 0]), np.array([0])))
self.assertTrue(obey_support(np.array([0.5, 0.5]), np.array([0, 1])))