Ejemplo n.º 1
0
 def test_wrong_input_type(self):
     element = 0.1
     with self.assertRaises(TypeError):
         extract_input_for_getitem(element)
Ejemplo n.º 2
0
 def test_input_tuple(self):
     element = (1, slice(1, 2))
     res_id, res_slice = extract_input_for_getitem(element)
     self.assertEqual(res_id, "1")
     self.assertEqual(res_slice, slice(1, 2))
Ejemplo n.º 3
0
 def test_input_too_large_tuple(self):
     element = (1, 2, 3)
     with self.assertRaises(TypeError):
         extract_input_for_getitem(element)
Ejemplo n.º 4
0
 def test_input_int(self):
     id_ = 1
     res_id, res_slice = extract_input_for_getitem(id_)
     self.assertEqual(res_id, "1")
     self.assertEqual(res_slice, None)