Esempio n. 1
0
    def testSimple(self):
        data = yaml.load(tests)

        for filename, md in data.items():
            print 'testing', filename
            query = MemoryObjectGraph()
            query.Media(filename = unicode(filename))

            schain = SolvingChain(MovieFilename(), MovieTMDB())
            result = schain.solve(query).find_all(Movie)

            self.assertEqual(len(result), 1, 'Solver coudn\'t solve anything...')
            result = result[0]

            for key, value in md.items():
                self.assertEqual(result.get(key), value)

            from smewt.base import cache
            cache.save('/tmp/smewt.cache')
Esempio n. 2
0
    def testSimple(self):
        data = yaml.load(tests)

        for filename, md in data.items():
            print 'testing', filename
            query = MemoryObjectGraph()
            query.Media(filename=unicode(filename))

            schain = SolvingChain(MovieFilename(), MovieTMDB())
            result = schain.solve(query).find_all(Movie)

            self.assertEqual(len(result), 1,
                             'Solver coudn\'t solve anything...')
            result = result[0]

            for key, value in md.items():
                self.assertEqual(result.get(key), value)

            from smewt.base import cache
            cache.save('/tmp/smewt.cache')
Esempio n. 3
0
def shutdown():
    cache.save('/tmp/smewt.cache')
Esempio n. 4
0
def shutdown():
    cache.save('/tmp/smewt.cache')
Esempio n. 5
0
 def saveCache(self):
     cache.save(self._cacheFilename())