Ejemplo n.º 1
0
 def test_1_vector_and_2_scalar_args(self):
     x = [1, 2, 3]
     pos, c_shape = args_flat(x, 2, 3)
     truepos = [[1, 2, 3], [2, 2, 3], [3, 2, 3]]
     truec_shape = (3, )
     assert_allclose(pos, truepos)
     assert c_shape == truec_shape
Ejemplo n.º 2
0
 def test_3_scalar_args_version2(self):
     pos1, c_shape1 = args_flat([1], 2, 3)
     truepos1 = [[1, 2, 3]]
     truec_shape1 = [
         1,
     ]
     self.assertListEqual(pos1.tolist(), truepos1)
     self.assertListEqual(list(c_shape1), truec_shape1)
Ejemplo n.º 3
0
 def test_1_vector_and_2_scalar_args(self):
     x = [1, 2, 3]
     pos, c_shape = args_flat(x, 2, 3)
     truepos = [[1, 2, 3], [2, 2, 3], [3, 2, 3]]
     truec_shape = [
         3,
     ]
     self.assertListEqual(pos.tolist(), truepos)
     self.assertListEqual(list(c_shape), truec_shape)
Ejemplo n.º 4
0
 def test_1_vector_and_2_scalar_args(self):
     x = [1, 2, 3]
     pos, c_shape = args_flat(x, 2, 3)
     truepos = [[1, 2, 3],
                [2, 2, 3],
                [3, 2, 3]]
     truec_shape = [3, ]
     self.assertListEqual(pos.tolist(), truepos)
     self.assertListEqual(list(c_shape), truec_shape)
Ejemplo n.º 5
0
 def test_3_scalar_args_version2(self):
     pos1, c_shape1 = args_flat([1], 2, 3)
     truepos1 = [[1, 2, 3]]
     truec_shape1 = (1, )
     assert_allclose(pos1, truepos1)
     assert c_shape1 == truec_shape1
Ejemplo n.º 6
0
 def test_1_vector_args(self):
     pos1, c_shape1 = args_flat([1, 2, 3])
     truepos1 = [[1, 2, 3]]
     truec_shape1 = None
     assert_allclose(pos1, truepos1)
     assert c_shape1 is truec_shape1
Ejemplo n.º 7
0
 def test_1_vector_args(self):
     pos1, c_shape1 = args_flat([1, 2, 3])
     truepos1 = [[1, 2, 3]]
     truec_shape1 = None
     self.assertListEqual(pos1.tolist(), truepos1)
     self.assertIs(c_shape1, truec_shape1)
Ejemplo n.º 8
0
 def test_3_scalar_args_version2(self):
     pos1, c_shape1 = args_flat([1], 2, 3)
     truepos1 = [[1, 2, 3]]
     truec_shape1 = [1, ]
     self.assertListEqual(pos1.tolist(), truepos1)
     self.assertListEqual(list(c_shape1), truec_shape1)
Ejemplo n.º 9
0
 def test_1_vector_args(self):
     pos1, c_shape1 = args_flat([1, 2, 3])
     truepos1 = [[1, 2, 3]]
     truec_shape1 = None
     self.assertListEqual(pos1.tolist(), truepos1)
     self.assertIs(c_shape1, truec_shape1)