def setUp(self): fakedata.start() self.vanilla = a2b.Cli(['1011.9999', '1001.1001v1', 'x']) self.vanilla.run() self.comments = a2b.Cli(['--comments', 'x']) self.comments.run() self.no_errors = a2b.Cli(['1001.1001']) self.no_errors.run() self.no_matches = a2b.Cli(['x']) self.no_matches.run()
def download_bibtex(self): bib_url = self.get_bibtex_url() bibtexCli = arxiv2bib.Cli([bib_url]) bibtexCli.run() self.logger.debug("[bibtex url] = %s" % bib_url) data = os.linesep.join(bibtexCli.output) self.bibtex_data = data
def download_bibtex(self): bib_url = self.get_bibtex_url() bibtexCli = arxiv2bib.Cli([bib_url]) bibtexCli.run() self.logger.debug("[bibtex url] = %s" % bib_url) data = ''.join(bibtexCli.output).replace('\n', ' ') self.bibtex_data = data
def download_bibtex(self) -> None: bib_url = self.get_bibtex_url() if not bib_url: return None bibtex_cli = arxiv2bib.Cli([bib_url]) bibtex_cli.run() self.logger.debug("[bibtex url] = %s" % bib_url) output = bibtex_cli.output # List[str] data = ''.join(output).replace('\n', ' ') self.bibtex_data = data
def test_catch_403_error(self, mock_uo): cli = a2b.Cli(['0000.0000']) self.assertRaises(a2b.FatalError, cli.run)
def test_read_from_stdin(self, mock_in): mock_in.__iter__.return_value = ['1', '2'] cli = a2b.Cli([]) self.assertEqual(cli.args.id, ['1', '2'])
def test_no_unneccesary_API_call(self, mock_uo): cli = a2b.Cli(['x']) mock_uo.assert_not_called()