コード例 #1
0
 def test_all_bad_tuple(self):
     with self.assertRaises(TypeError):
         _normalise_axis((2.8, '23', {6: 3}), ARRAY)
コード例 #2
0
 def test_str(self):
     with self.assertRaises(TypeError):
         _normalise_axis('23', ARRAY)
コード例 #3
0
 def test_mixed_tuple(self):
     with self.assertRaises(TypeError):
         _normalise_axis((2, '23', 6), ARRAY)
コード例 #4
0
 def test_dict(self):
     with self.assertRaises(TypeError):
         _normalise_axis({}, ARRAY)
コード例 #5
0
 def test_float(self):
     with self.assertRaises(TypeError):
         _normalise_axis(2.3, ARRAY)
コード例 #6
0
 def check(self, argument, expected):
     result = _normalise_axis(argument, ARRAY)
     self.assertEqual(result, expected)
     self.assertIsInstance(result, tuple)
コード例 #7
0
 def test_builtin(self):
     with self.assertRaises(TypeError):
         _normalise_axis(open, ARRAY)
コード例 #8
0
 def test_all_bad_tuple(self):
     with self.assertRaises(TypeError):
         _normalise_axis((2.8, '23', {6: 3}), ARRAY)
コード例 #9
0
 def test(self):
     self.assertIs(_normalise_axis(None, ARRAY), None)
コード例 #10
0
 def test_str(self):
     with self.assertRaises(TypeError):
         _normalise_axis('23', ARRAY)
コード例 #11
0
 def test_mixed_tuple(self):
     with self.assertRaises(TypeError):
         _normalise_axis((2, '23', 6), ARRAY)
コード例 #12
0
 def test_float(self):
     with self.assertRaises(TypeError):
         _normalise_axis(2.3, ARRAY)
コード例 #13
0
 def test_dict(self):
     with self.assertRaises(TypeError):
         _normalise_axis({}, ARRAY)
コード例 #14
0
 def test_builtin(self):
     with self.assertRaises(TypeError):
         _normalise_axis(open, ARRAY)
コード例 #15
0
 def check(self, argument, expected):
     result = _normalise_axis(argument, ARRAY)
     self.assertEqual(result, expected)
     self.assertIsInstance(result, tuple)
コード例 #16
0
 def test(self):
     self.assertIs(_normalise_axis(None, ARRAY), None)