def test_cursor_creation(self): # Check value ilist = Cursor([1]) self.assertEqual(str(ilist), "1") self.assertEqual(repr(ilist), "Cursor([1])") self.assertEqual(len(ilist), 1) # Check values ilist = Cursor(['1', '2']) self.assertEqual(str(ilist), "1, 2") self.assertEqual(repr(ilist), "Cursor(['1', '2'])") self.assertEqual(len(ilist), 2)
def test_cursor_initial(self): # Check initial ilist = Cursor() self.assertEqual(str(ilist), '') self.assertEqual(repr(ilist), 'Cursor()') self.assertEqual(len(ilist), 0)
def test_cursor_valid_list_1_item_option(self): for option in CURSOR_OPTIONS: cursor = parser.cursor([option]) self.assertIsInstance(cursor, Cursor) self.assertEqual(cursor, Cursor([option]))