示例#1
0
 def test_yaml(self):
     #FIXME: The string gets created, but the loading does not work
     import io
     docs = self.get_docs()
     string = run(docs, yaml=True)
     self.assertTrue(len(string) > 0)
     yamlfile = open(tempfile.mktemp(), 'w+')
     yamlfile.write(string)
     data = yaml.load_all(yamlfile)
     self.assertTrue(data is not None)
示例#2
0
 def test_yaml(self):
     docs = self.get_docs()
     string = run(docs, yaml=True)
     self.assertTrue(len(string) > 0)
     yamlfile = tempfile.mktemp()
     with open(yamlfile, 'w+') as fd:
         fd.write(string)
     with open(yamlfile) as fd:
         data = list(yaml.load_all(fd))
     self.assertTrue(data is not None)
     self.assertTrue(len(list(data)) > 0)
示例#3
0
 def test_text(self):
     docs = self.get_docs()
     string = run(docs, text=True)
     self.assertTrue(len(string) > 0)
     data = string.split('\n')
     self.assertTrue(len(data) > 0)
示例#4
0
 def test_json(self):
     docs = self.get_docs()
     string = run(docs, json=True)
     self.assertTrue(len(string) > 0)
     data = json.loads(string)
     self.assertTrue(len(data) > 0)
示例#5
0
 def test_bibtex(self):
     docs = self.get_docs()
     string = run(docs, bibtex=True)
     self.assertTrue(len(string) > 0)
     data = papis.bibtex.bibtex_to_dict(string)
     self.assertTrue(len(data) > 0)
示例#6
0
 def test_json(self):
     docs = self.get_docs()
     string = run(docs, to_format='json')
     self.assertTrue(len(string) > 0)
     data = json.loads(string)
     self.assertTrue(len(data) > 0)