Ejemplo n.º 1
0
 def test_cache(self):
     _ = cache.load_hyphenator(lang='en')
     _ = cache.load_spacy('en')
     self.assertTrue(len(cache.LRU_CACHE.keys()) >= 2)
     # check cache size; low thresh but still larger than if the size of
     # loaded data was not being correctly assessed
     self.assertTrue(cache.LRU_CACHE.currsize >= 1000)
Ejemplo n.º 2
0
def test_cache_clear():
    cache.clear()
    _ = cache.load_hyphenator(lang="en")
    _ = cache.load_spacy("en")
    assert len(cache.LRU_CACHE.keys()) >= 2
    # check cache size; low thresh but still larger than if the size of
    # loaded data was not being correctly assessed
    assert cache.LRU_CACHE.currsize >= 1000
Ejemplo n.º 3
0
def test_load_pyphen():
    for lang in ("en", "es"):
        _ = cache.load_hyphenator(lang=lang)
        assert True
Ejemplo n.º 4
0
def test_load_pyphen():
    for lang in ('en', 'es'):
        _ = cache.load_hyphenator(lang=lang)
        assert True
Ejemplo n.º 5
0
 def test_load_pyphen(self):
     for lang in ('en', 'es'):
         _ = cache.load_hyphenator(lang=lang)