Skip to content

Commit 2b1bbc4

Browse files
committed
[test] Add odmlconvert script test
1 parent a231956 commit 2b1bbc4

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

test/test_script_odml_convert.py

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

0 commit comments

Comments
 (0)