def test_all_bad_tuple(self): with self.assertRaises(TypeError): _normalise_axis((2.8, '23', {6: 3}), ARRAY)
def test_str(self): with self.assertRaises(TypeError): _normalise_axis('23', ARRAY)
def test_mixed_tuple(self): with self.assertRaises(TypeError): _normalise_axis((2, '23', 6), ARRAY)
def test_dict(self): with self.assertRaises(TypeError): _normalise_axis({}, ARRAY)
def test_float(self): with self.assertRaises(TypeError): _normalise_axis(2.3, ARRAY)
def check(self, argument, expected): result = _normalise_axis(argument, ARRAY) self.assertEqual(result, expected) self.assertIsInstance(result, tuple)
def test_builtin(self): with self.assertRaises(TypeError): _normalise_axis(open, ARRAY)
def test(self): self.assertIs(_normalise_axis(None, ARRAY), None)