Skip to content

Commit 01b3e4b

Browse files
committed
[test] Add odmltordf script test
1 parent e8c622f commit 01b3e4b

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

test/test_script_odml_to_rdf.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import os
2+
import shutil
3+
import unittest
4+
5+
from docopt import DocoptExit
6+
7+
from odml.scripts import odml_to_rdf
8+
9+
from . import util
10+
11+
12+
class TestScriptOdmlToRDF(unittest.TestCase):
13+
14+
def setUp(self):
15+
self.tmp_dir = util.create_test_dir(__file__)
16+
17+
def tearDown(self):
18+
if self.tmp_dir and os.path.exists(self.tmp_dir):
19+
shutil.rmtree(self.tmp_dir)
20+
21+
def test_script_exit(self):
22+
with self.assertRaises(DocoptExit):
23+
odml_to_rdf.main([])
24+
25+
with self.assertRaises(DocoptExit):
26+
odml_to_rdf.main(["-o", self.tmp_dir])
27+
28+
with self.assertRaises(SystemExit):
29+
odml_to_rdf.main(["-h"])
30+
31+
with self.assertRaises(SystemExit):
32+
odml_to_rdf.main(["--version"])

0 commit comments

Comments
 (0)