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)))
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)))
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)))
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)))