Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
outfile = tempfile.NamedTemporaryFile().name
betterbib.cli.format([infile, outfile])
with open(outfile, "r") as f:
assert f.read() == (
(
"%comment{{This file was created with betterbib v{}.}}\n"
"\n"
"\n"
"@article{{foobar,\n"
" doi = {{foobar}},\n"
" url = {{https://doi.org/foobar}},\n"
"}}\n"
).format(betterbib.__version__)
)
os.remove(infile)
os.remove(outfile)
return
"}"
)
outfile = tempfile.NamedTemporaryFile().name
betterbib.cli.dedup_doi([infile, outfile])
with open(outfile, "r") as f:
assert f.read() == (
(
"%comment{{This file was created with betterbib v{}.}}\n"
"\n"
"@article{{foobar,\n"
" url = {{https://doi.org/foobar}},\n"
"}}\n"
"\n"
).format(betterbib.__version__)
)
os.remove(infile)
os.remove(outfile)
return