/
test_datmo.py
46 lines (38 loc) · 1.2 KB
/
test_datmo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
Tests for Project Commands
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# TODO: include builtin libraries for the appropriate Python
# try:
# import __builtin__
# except ImportError:
# # Python 3
# import builtins as __builtin__
import os
import tempfile
import platform
from datmo.config import Config
from datmo.cli.driver.helper import Helper
from datmo.cli.command.datmo_command import DatmoCommand
class TestDatmo():
def setup_class(self):
# provide mountable tmp directory for docker
tempfile.tempdir = "/tmp" if not platform.system(
) == "Windows" else None
test_datmo_dir = os.environ.get('TEST_DATMO_DIR',
tempfile.gettempdir())
self.temp_dir = tempfile.mkdtemp(dir=test_datmo_dir)
Config().set_home(self.temp_dir)
self.cli = Helper()
def teardown_class(self):
pass
def test_datmo_base(self):
base = DatmoCommand(self.cli)
base.parse([])
assert base.execute()
def test_datmo_help(self):
base = DatmoCommand(self.cli)
base.parse(["--help"])
assert base.execute()