diff options
| author | Donny Winston <dwinston@alum.mit.edu> | 2020-08-05 09:46:00 -0400 |
|---|---|---|
| committer | Donny Winston <dwinston@alum.mit.edu> | 2020-08-05 09:46:00 -0400 |
| commit | fe06a14fc78ee579170ac85aed185796f93c0d54 (patch) | |
| tree | 7bfc512049303ad462bab6a446a87a8d1d8304ec | |
| parent | 1c47bb409f46b9da3a8086e89b2faf3cb05e793e (diff) | |
| download | rdflib-fe06a14fc78ee579170ac85aed185796f93c0d54.tar.gz | |
add test to ensure -o flag success
| -rw-r--r-- | test/test_csv2rdf.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_csv2rdf.py b/test/test_csv2rdf.py index c35124ee..d0bba696 100644 --- a/test/test_csv2rdf.py +++ b/test/test_csv2rdf.py @@ -1,5 +1,8 @@ import subprocess import unittest +from os import remove +from tempfile import mkstemp + class CSV2RDFTest(unittest.TestCase): def test_csv2rdf_cli(self): @@ -14,3 +17,11 @@ class CSV2RDFTest(unittest.TestCase): self.assertRegex(completed.stderr, r"Took [\d\.]+ seconds.") self.assertIn("<http://example.org/instances/0>", completed.stdout) self.assertIn("<http://example.org/props/zip>", completed.stdout) + + def test_csv2rdf_cli_fileout(self): + _, fname = mkstemp() + completed = subprocess.run(["csv2rdf", "-o", fname, "test/csv/realestate.csv"],) + self.assertEqual(completed.returncode, 0) + with open(fname) as f: + self.assertGreater(len(f.readlines()), 0) + remove(fname) |
