def test_load_etext(self): loaders = (lambda etextno: load_etext(etextno, refresh_cache=True), lambda etextno: load_etext(etextno, refresh_cache=False)) testcases = ( SampleMetaData.for_etextno(2701), # newstyle identifier SampleMetaData.for_etextno(5), # oldstyle identifier SampleMetaData.for_etextno(14287), # unicode text SampleMetaData.for_etextno(23962) # UTF-8 text ) for testcase, loader in itertools.product(testcases, loaders): text = loader(testcase.etextno) self.assertIsInstance(text, unicode)
def test_load_etext(self): loaders = (lambda etextno: load_etext(etextno, refresh_cache=True), lambda etextno: load_etext(etextno, refresh_cache=False)) testcases = ( SampleMetaData.for_etextno(2701), # newstyle identifier SampleMetaData.for_etextno(5), # oldstyle identifier SampleMetaData.for_etextno(14287), # unicode text SampleMetaData.for_etextno(23962) # UTF-8 text ) for testcase, loader in itertools.product(testcases, loaders): text = loader(testcase.etextno) self.assertTrue(isinstance(text, str))
def sample_data(self): return SampleMetaData.all()