<s> from tests . testing_framework . base_test_cases import BaseTestCase <EOL> from hamcrest import * <EOL> from tests . testing_framework . doubles . files import FileMock <EOL> DEFAULT_CONTENT = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> class FileMockTests ( BaseTestCase ) : <EOL> def before ( self ) : <EOL> self . mock = FileMock ( DEFAULT_CONTENT ) <EOL> def test_file_mock_is_iterable ( self ) : <EOL> counter = <NUM_LIT:0> <EOL> for line in self . mock : <EOL> assert_that ( line , equal_to ( DEFAULT_CONTENT [ counter ] ) ) <EOL> counter += <NUM_LIT:1> <EOL> def test_file_mock_is_readable_as_a_file ( self ) : <EOL> expected_output = "<STR_LIT>" . join ( DEFAULT_CONTENT ) <EOL> assert_that ( self . mock . read ( ) , equal_to ( expected_output ) ) <EOL> self . mock . close ( ) </s>
