<s> from . import utils <EOL> from mock import mock_open , patch <EOL> from scrapi . processing . storage import StorageProcessor <EOL> from scrapi . linter . document import RawDocument , NormalizedDocument <EOL> test_db = StorageProcessor ( ) <EOL> RAW = RawDocument ( utils . RAW_DOC ) <EOL> NORMALIZED = NormalizedDocument ( utils . NORMALIZED_DOC ) <EOL> @ patch ( '<STR_LIT>' ) <EOL> def test_process_normalized ( mock_os ) : <EOL> mock_os . path . exists . return_value = False <EOL> filename = '<STR_LIT>' . format ( RAW [ '<STR_LIT:source>' ] , RAW [ '<STR_LIT>' ] ) <EOL> m = mock_open ( ) <EOL> with patch ( '<STR_LIT>' , m , create = True ) : <EOL> test_db . process_normalized ( RAW , NORMALIZED ) <EOL> m . assert_called_once_with ( filename , '<STR_LIT:w>' ) <EOL> @ patch ( '<STR_LIT>' ) <EOL> def test_process_raw ( mock_os ) : <EOL> mock_os . path . exists . return_value = False <EOL> filename = '<STR_LIT>' . format ( RAW [ '<STR_LIT:source>' ] , RAW [ '<STR_LIT>' ] , RAW [ '<STR_LIT>' ] ) <EOL> m = mock_open ( ) <EOL> with patch ( '<STR_LIT>' , m , create = True ) : <EOL> test_db . process_raw ( RAW ) <EOL> m . assert_called_once_with ( filename , '<STR_LIT:w>' ) </s>
