コード例 #1
0
ファイル: test_cache.py プロジェクト: LinguList/lingpy
    def test_cache(self):
        d = {'a': 123}
        filename = 'lingpy_test.CSV'
        cache.dump(d, filename)

        self.assertTrue(cache.path(filename).exists())
        self.assertEqual(cache.load(filename), d)
        os.remove(str(cache.path(filename)))
コード例 #2
0
ファイル: test_parser.py プロジェクト: LinguList/lingpy
    def test_cache(self):
        filename = 'lingpy_test.qlc'
        self.parser.pickle(filename=filename)
        from_cache = QLCParser.unpickle(filename)
        self.assertEqual(self.parser.header, from_cache.header)
        os.remove(str(path(filename)))

        wl = Wordlist(test_data('KSL.qlc'))
        wl.pickle(filename=filename)
        from_cache = Wordlist.unpickle(filename)
        self.assert_(from_cache._class)
        os.remove(str(path(filename)))
コード例 #3
0
    def test_cache(self):
        filename = 'lingpy_test.qlc'
        self.parser.pickle(filename=filename)
        from_cache = QLCParser.unpickle(filename)
        self.assertEqual(self.parser.header, from_cache.header)
        os.remove(str(path(filename)))

        wl = Wordlist(test_data('KSL.qlc'))
        wl.pickle(filename=filename)
        from_cache = Wordlist.unpickle(filename)
        self.assertTrue(from_cache._class)
        os.remove(str(path(filename)))
コード例 #4
0
    def test_cache(self):
        from lingpy.basic.parser import QLCParser
        from lingpy.basic.wordlist import Wordlist
        from lingpy.cache import path

        filename = 'lingpy_test.qlc'
        self.parser.pickle(filename=filename)
        from_cache = QLCParser.unpickle(filename)
        self.assertEqual(self.parser.header, from_cache.header)
        os.remove(str(path(filename)))

        wl = Wordlist(test_data('KSL.qlc'))
        wl.pickle(filename=filename)
        from_cache = Wordlist.unpickle(filename)
        self.assert_(from_cache._class)
        os.remove(str(path(filename)))