<s> from mock import Mock <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> import os <EOL> from shiva . app import app <EOL> from shiva . indexer . main import Indexer <EOL> class IndexerTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . config = { <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , ) , <EOL> } <EOL> with app . test_request_context ( ) : <EOL> self . indexer = Indexer ( self . config ) <EOL> os . path . isfile = Mock ( ) <EOL> def test_track_detection ( self ) : <EOL> self . indexer . file_path = '<STR_LIT>' <EOL> self . assertTrue ( self . indexer . is_track ( ) ) <EOL> def test_extension_detection ( self ) : <EOL> self . indexer . file_path = '<STR_LIT>' <EOL> self . assertEqual ( self . indexer . get_extension ( ) , '<STR_LIT>' ) <EOL> def test_runs ( self ) : <EOL> self . assertIsNone ( self . indexer . run ( ) ) </s>
