class TestACMGetMap(unittest.TestCase):
    def setUp(self):
        self.acm = ACM(a=1, b=1, n=2)

    @unittest.expectedFailure
    def test_validation_get_map_is_good(self):
        try:
            self.acm.get_map(2)
            self.fail('Validation is succeed and no errors')
        except ValidationError as validation_error:
            actual = validation_error.errors
            expected = "matrix dimension is too small"
            self.assertEqual(expected, actual)

    def test_validation_get_map_problem(self):
        try:
            self.acm.get_map(1)
            self.fail('Validation is succeed and no errors')
        except ValidationError as validation_error:
            actual = validation_error.errors
            expected = "matrix dimension is too small"
            self.assertEqual(expected, actual)
Example #2
0
 def test_type_one_not_period(self):
     acm = ACM(a=2, b=3, n=3)
     actual = acm.get_map(8)  # 3 is not the period of this form
     expected = self.create_simple_map(8)
     self.assertFalse(np.array_equal(expected, actual))
Example #3
0
 def test_type_zero_not_period(self):
     acm = ACM(a=1, b=1, n=1)
     actual = acm.get_map(7)  # 1 is not the period of this form
     expected = self.create_simple_map(7)
     print(expected.any)
     self.assertFalse(np.array_equal(expected, actual))
Example #4
0
 def test_type_one_period(self):
     acm = ACM(a=2, b=3, n=4)
     actual = acm.get_map(8)  # 4 is the period of this form
     expected = self.create_simple_map(8)
     self.assertTrue(np.array_equal(expected, actual))
Example #5
0
 def test_type_zero_period(self):
     acm = ACM(a=1, b=1, n=8)
     actual = acm.get_map(7)  # 8 is the period of this form
     expected = self.create_simple_map(7)
     self.assertTrue(np.array_equal(expected, actual))