<s> import unittest <EOL> import collections_and_iterators <EOL> """<STR_LIT>""" <EOL> class TestObjectMethods ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . singleLinkList = collections_and_iterators . SinglyLinkedList ( ) <EOL> self . singleLinkListData = collections_and_iterators . SinglyLinkedList ( ) <EOL> self . singleLinkListData . append ( "<STR_LIT>" ) <EOL> self . singleLinkListData . append ( "<STR_LIT>" ) <EOL> self . singleLinkListData . append ( "<STR_LIT>" ) <EOL> self . doubleLinkList = collections_and_iterators . DoublyLinkedList ( ) <EOL> self . doubleLinkListData = collections_and_iterators . DoublyLinkedList ( ) <EOL> self . doubleLinkListData . append ( "<STR_LIT>" ) <EOL> self . doubleLinkListData . append ( "<STR_LIT>" ) <EOL> self . doubleLinkListData . append ( "<STR_LIT>" ) <EOL> def test_empty_single_list ( self ) : <EOL> self . assertEqual ( <NUM_LIT:0> , self . singleLinkList . size ) <EOL> self . assertIsNone ( self . singleLinkList . head ) <EOL> self . assertIsNone ( self . singleLinkList . cursor ) <EOL> def test_contains_success ( self ) : <EOL> self . assertTrue ( "<STR_LIT>" in self . singleLinkListData ) <EOL> self . assertTrue ( "<STR_LIT>" in self . singleLinkListData ) <EOL> self . assertTrue ( "<STR_LIT>" in self . singleLinkListData ) <EOL> def test_contains_failure ( self ) : <EOL> self . assertFalse ( "<STR_LIT>" in self . singleLinkListData ) <EOL> self . assertFalse ( "<STR_LIT>" in self . singleLinkListData ) <EOL> def test_append_success ( self ) : <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData [ <NUM_LIT:1> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData [ <NUM_LIT:2> ] ) <EOL> def test_append_failure ( self ) : <EOL> with self . assertRaises ( IndexError ) : <EOL> self . singleLinkListData [ <NUM_LIT:3> ] <EOL> self . singleLinkListData . append ( "<STR_LIT>" ) <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData [ <NUM_LIT:3> ] ) <EOL> def test_getitem_success ( self ) : <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData . __getitem__ ( <NUM_LIT:0> ) ) <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData . __getitem__ ( <NUM_LIT:1> ) ) <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData . __getitem__ ( <NUM_LIT:2> ) ) <EOL> def test_getitem_failure ( self ) : <EOL> with self . assertRaises ( IndexError ) : <EOL> self . singleLinkListData . __getitem__ ( <NUM_LIT:3> ) <EOL> self . singleLinkListData . __getitem__ ( - <NUM_LIT:3> ) <EOL> def test_setitem_success ( self ) : <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData [ <NUM_LIT:0> ] ) <EOL> self . singleLinkListData [ <NUM_LIT:0> ] = "<STR_LIT>" <EOL> self . assertEqual ( "<STR_LIT>" , self . singleLinkListData [ <NUM_LIT:0> ] ) <EOL> def test_setitem_failure ( self ) : <EOL> with self . assertRaises ( IndexError ) : <EOL> self . singleLinkListData [ <NUM_LIT:5> ] = "<STR_LIT>" <EOL> self . singleLinkListData [ - <NUM_LIT:1> ] = "<STR_LIT>" <EOL> def test_empty_double_list ( self ) : <EOL> self . assertEqual ( <NUM_LIT:0> , self . doubleLinkList . size ) <EOL> self . assertIsNone ( self . doubleLinkList . head ) <EOL> self . assertIsNone ( self . doubleLinkList . cursor ) <EOL> def test_insert_success ( self ) : <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:1> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:2> ] ) <EOL> self . doubleLinkListData . insert ( "<STR_LIT>" , <NUM_LIT:0> ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:1> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:2> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:3> ] ) <EOL> self . doubleLinkListData . insert ( "<STR_LIT>" , <NUM_LIT:2> ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:1> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:2> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:3> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , self . doubleLinkListData [ <NUM_LIT:4> ] ) <EOL> def test_insert_fauilure ( self ) : <EOL> pass <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( verbosity = <NUM_LIT:2> ) </s>
