示例#1
0
 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)
示例#2
0
 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))
示例#3
0
 def sample_data(self):
     return SampleMetaData.all()
示例#4
0
 def sample_data(self):
     return SampleMetaData.all()