<s> '''<STR_LIT>''' <EOL> from tinkerer import master <EOL> from tinkertest import utils <EOL> class TestMaster ( utils . BaseTinkererTest ) : <EOL> MASTER_HEAD = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT:\n>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT:\n>" ] <EOL> MASTER_TAIL = [ "<STR_LIT:\n>" ] <EOL> def test_setup ( self ) : <EOL> self . assertEquals ( <EOL> TestMaster . MASTER_HEAD + TestMaster . MASTER_TAIL , <EOL> master . read_master ( ) ) <EOL> def test_append ( self ) : <EOL> new_docs = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> master . append_doc ( new_docs [ <NUM_LIT:0> ] ) <EOL> self . assertEquals ( <EOL> TestMaster . MASTER_HEAD + <EOL> [ "<STR_LIT>" % new_docs [ <NUM_LIT:0> ] ] + <EOL> TestMaster . MASTER_TAIL , <EOL> master . read_master ( ) ) <EOL> master . append_doc ( new_docs [ <NUM_LIT:1> ] ) <EOL> self . assertEquals ( <EOL> TestMaster . MASTER_HEAD + <EOL> [ "<STR_LIT>" % new_docs [ <NUM_LIT:0> ] , "<STR_LIT>" % new_docs [ <NUM_LIT:1> ] ] + <EOL> TestMaster . MASTER_TAIL , <EOL> master . read_master ( ) ) <EOL> def test_prepend ( self ) : <EOL> new_docs = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> master . prepend_doc ( new_docs [ <NUM_LIT:0> ] ) <EOL> self . assertEquals ( <EOL> TestMaster . MASTER_HEAD + <EOL> [ "<STR_LIT>" % new_docs [ <NUM_LIT:0> ] ] + <EOL> TestMaster . MASTER_TAIL , <EOL> master . read_master ( ) ) <EOL> master . prepend_doc ( new_docs [ <NUM_LIT:1> ] ) <EOL> self . assertEquals ( <EOL> TestMaster . MASTER_HEAD + <EOL> [ "<STR_LIT>" % new_docs [ <NUM_LIT:1> ] , "<STR_LIT>" % new_docs [ <NUM_LIT:0> ] ] + <EOL> TestMaster . MASTER_TAIL , <EOL> master . read_master ( ) ) <EOL> def test_remove ( self ) : <EOL> new_docs = [ "<STR_LIT:a>" , "<STR_LIT:b>" , "<STR_LIT:c>" , "<STR_LIT:d>" ] <EOL> for doc in new_docs : <EOL> master . append_doc ( doc ) <EOL> for doc_to_remove in [ "<STR_LIT:c>" , "<STR_LIT:b>" , "<STR_LIT:d>" ] : <EOL> master . remove_doc ( doc_to_remove ) <EOL> new_docs . remove ( doc_to_remove ) <EOL> self . assertEquals ( <EOL> TestMaster . MASTER_HEAD + <EOL> [ "<STR_LIT>" % doc for doc in new_docs ] + <EOL> TestMaster . MASTER_TAIL , <EOL> master . read_master ( ) ) </s>
