Пример #1
0
 def test_wrong_length(self):
     try:
         assert_matrix_almost_equal(matrix([[1, 2], [3, 4]]),
                                    matrix([[1, 2, 3], [4, 5, 6]]))
         assert False
     except AssertionError:
         pass
Пример #2
0
 def test_wrong_value(self):
     try:
         assert_matrix_almost_equal(matrix([[1, 2], [3, 4]]),
                                    matrix([[1.0000001, 2], [3, 4]]))
         assert False
     except AssertionError:
         pass
Пример #3
0
 def test_wrong_value(self):
     try:
         assert_matrix_almost_equal(matrix([[1, 2], [3, 4]]),
                                     matrix([[1.0000001, 2], [3, 4]]))
         assert False
     except AssertionError:
         pass
Пример #4
0
 def test_wrong_length(self):
     try:
         assert_matrix_almost_equal(matrix([[1, 2], [3, 4]]),
                                    matrix([[1, 2, 3], [4, 5, 6]]))
         assert False
     except AssertionError:
         pass
Пример #5
0
 def test__passes(self):
     assert_matrix_almost_equal(matrix([[1, 2], [3, 4]]),
                                matrix([[1.00000001, 2], [3, 4]]))
     assert_matrix_almost_equal(matrix([[1, 2], [3, 4]]),
                                matrix([[1.0000001, 2], [3, 4]]), 6)
 def test_defaultReferenceValue(self):
     # The following tests depemd on this
     assert_matrix_almost_equal(self.calc._ubcalc.reference.n_phi, matrix([[0], [0], [1]]))
Пример #7
0
 def test__passes(self):
     assert_matrix_almost_equal(matrix([[1, 2], [3, 4]]),
                                matrix([[1.00000001, 2], [3, 4]]))
     assert_matrix_almost_equal(matrix([[1, 2], [3, 4]]),
                                matrix([[1.0000001, 2], [3, 4]]), 6)
Пример #8
0
 def test_defaultReferenceValue(self):
     # The following tests depemd on this
     assert_matrix_almost_equal(self.calc._ubcalc.n_phi,
                                matrix([[0], [0], [1]]))