def test_pair_from_array_raises_exception_if_argument_is_not_a_2d_array(self): # noqa with self.assertRaises(GeometryException) as error_context: Pair.from_array(numpy.array([2, 3, 5])) self.assertEqual( error_context.exception.message, "Can only be created from a 2d array", )
def test_pair_from_array_creates_an_instance_from_a_2d_numpy_array(self): p = Pair.from_array(numpy.array([2, 3])) self.assertIsInstance(p, Pair) self.assertEqual(p.a[0], 2) self.assertEqual(p.a[1], 3)