<s> from os . path import dirname , join <EOL> from django . test import TestCase <EOL> from chronam . core . ocr_extractor import ocr_extractor <EOL> class OcrExtractorTests ( TestCase ) : <EOL> def test_extractor ( self ) : <EOL> dir = join ( dirname ( dirname ( __file__ ) ) , '<STR_LIT>' ) <EOL> ocr_file = join ( dir , '<STR_LIT>' ) <EOL> text , coord_info = ocr_extractor ( ocr_file ) <EOL> coords = coord_info [ "<STR_LIT>" ] <EOL> expected_text = { "<STR_LIT>" : file ( join ( dir , '<STR_LIT>' ) ) . read ( ) . decode ( '<STR_LIT:utf-8>' ) } <EOL> self . assertEqual ( text , expected_text ) <EOL> self . assertEqual ( len ( coords . keys ( ) ) , <NUM_LIT> ) <EOL> self . assertEqual ( len ( coords [ '<STR_LIT>' ] ) , <NUM_LIT:3> ) <EOL> self . assertTrue ( coords . has_key ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( not coords . has_key ( '<STR_LIT>' ) ) </s>
