Exemplo n.º 1
0
    def test_constructor(self):
        '''Test the Indexer constructor.'''
        indexer = Indexer()
        self.assertTrue(isinstance(indexer, Indexer))

        self.assertTrue(isinstance(indexer.logger, Logger))
        self.assertTrue(isinstance(indexer.configuration, Configuration))
Exemplo n.º 2
0
 def test_supported_filetypes(self):
     '''Test Indexer.supported_filetypes.'''
     indexer = Indexer()
     self.assertEquals(len(indexer.supported_filetypes), 14)
     self.assertEquals(sorted(indexer.supported_filetypes), [
         'avi', 'jpeg', 'jpg', 'm4v', 'mkv', 'mov', 'mp3', 'mp4', 'mpeg',
         'mpg', 'ogg', 'ogm', 'png', 'wmv'
     ])
Exemplo n.º 3
0
 def test_run(self):
     '''Test the indexer runs and indexes the proper media.'''
     indexer = Indexer()
     indexer.run()
Exemplo n.º 4
0
 def test_is_not_supported_filetype(self):
     '''Test Indexer.is_supported_filetype with an unsupported filetype.'''
     indexer = Indexer()
     self.assertFalse(indexer.is_supported_filetype('not.aeiou'))
Exemplo n.º 5
0
 def test_is_supported_filetype(self):
     '''Test Indexer.is_supported_filetype with a supported filetype.'''
     indexer = Indexer()
     self.assertTrue(indexer.is_supported_filetype('foo.avi'))
     self.assertTrue(indexer.is_supported_filetype('baz.bar.mp3'))
Exemplo n.º 6
0
 def test_invalid_get_filetype_handler(self):
     '''Test Indexer.get_filetype_handler with an invalid filetype.'''
     indexer = Indexer()
     self.assertEquals(indexer.get_filetype_handler('aeiou'), None)
Exemplo n.º 7
0
 def test_valid_get_filetype_handler(self):
     '''Test Indexer.get_filetype_handler with a valid filetype.'''
     indexer = Indexer()
     self.assertTrue(type(indexer.get_filetype_handler('avi')),
         AviHandler)
Exemplo n.º 8
0
 def test_run(self):
     '''Test the indexer runs and indexes the proper media.'''
     indexer = Indexer()
     indexer.run()
Exemplo n.º 9
0
 def test_is_not_supported_filetype(self):
     '''Test Indexer.is_supported_filetype with an unsupported filetype.'''
     indexer = Indexer()
     self.assertFalse(indexer.is_supported_filetype('not.aeiou'))
Exemplo n.º 10
0
 def test_is_supported_filetype(self):
     '''Test Indexer.is_supported_filetype with a supported filetype.'''
     indexer = Indexer()
     self.assertTrue(indexer.is_supported_filetype('foo.avi'))
     self.assertTrue(indexer.is_supported_filetype('baz.bar.mp3'))
Exemplo n.º 11
0
 def test_invalid_get_filetype_handler(self):
     '''Test Indexer.get_filetype_handler with an invalid filetype.'''
     indexer = Indexer()
     self.assertEquals(indexer.get_filetype_handler('aeiou'), None)
Exemplo n.º 12
0
 def test_valid_get_filetype_handler(self):
     '''Test Indexer.get_filetype_handler with a valid filetype.'''
     indexer = Indexer()
     self.assertTrue(type(indexer.get_filetype_handler('avi')), AviHandler)