<s> LOG_LOCATION = '<STR_LIT>' <EOL> import unittest <EOL> from ant . core . log import * <EOL> class LogReaderTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> lw = LogWriter ( LOG_LOCATION ) <EOL> lw . logOpen ( ) <EOL> lw . logRead ( '<STR_LIT>' ) <EOL> lw . logWrite ( '<STR_LIT:\x00>' ) <EOL> lw . logRead ( '<STR_LIT>' ) <EOL> lw . logClose ( ) <EOL> lw . close ( ) <EOL> self . log = LogReader ( LOG_LOCATION ) <EOL> def test_open_close ( self ) : <EOL> self . assertTrue ( self . log . is_open ) <EOL> self . log . close ( ) <EOL> self . assertFalse ( self . log . is_open ) <EOL> self . log . open ( LOG_LOCATION ) <EOL> self . assertTrue ( self . log . is_open ) <EOL> def test_read ( self ) : <EOL> t1 = self . log . read ( ) <EOL> t2 = self . log . read ( ) <EOL> t3 = self . log . read ( ) <EOL> t4 = self . log . read ( ) <EOL> t5 = self . log . read ( ) <EOL> self . assertEquals ( self . log . read ( ) , None ) <EOL> self . assertEquals ( t1 [ <NUM_LIT:0> ] , EVENT_OPEN ) <EOL> self . assertTrue ( isinstance ( t1 [ <NUM_LIT:1> ] , int ) ) <EOL> self . assertEquals ( len ( t1 ) , <NUM_LIT:2> ) <EOL> self . assertEquals ( t2 [ <NUM_LIT:0> ] , EVENT_READ ) <EOL> self . assertTrue ( isinstance ( t1 [ <NUM_LIT:1> ] , int ) ) <EOL> self . assertEquals ( len ( t2 ) , <NUM_LIT:3> ) <EOL> self . assertEquals ( t2 [ <NUM_LIT:2> ] , '<STR_LIT>' ) <EOL> self . assertEquals ( t3 [ <NUM_LIT:0> ] , EVENT_WRITE ) <EOL> self . assertTrue ( isinstance ( t1 [ <NUM_LIT:1> ] , int ) ) <EOL> self . assertEquals ( len ( t3 ) , <NUM_LIT:3> ) <EOL> self . assertEquals ( t3 [ <NUM_LIT:2> ] , '<STR_LIT:\x00>' ) <EOL> self . assertEquals ( t4 [ <NUM_LIT:0> ] , EVENT_READ ) <EOL> self . assertEquals ( t4 [ <NUM_LIT:2> ] , '<STR_LIT>' ) <EOL> self . assertEquals ( t5 [ <NUM_LIT:0> ] , EVENT_CLOSE ) <EOL> self . assertTrue ( isinstance ( t1 [ <NUM_LIT:1> ] , int ) ) <EOL> self . assertEquals ( len ( t5 ) , <NUM_LIT:2> ) <EOL> class LogWriterTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . log = LogWriter ( LOG_LOCATION ) <EOL> def test_open_close ( self ) : <EOL> self . assertTrue ( self . log . is_open ) <EOL> self . log . close ( ) <EOL> self . assertFalse ( self . log . is_open ) <EOL> self . log . open ( LOG_LOCATION ) <EOL> self . assertTrue ( self . log . is_open ) <EOL> def test_log ( self ) : <EOL> pass </s>
