Skip to content

Commit 333e346

Browse files
committed
test(translate_cli_test): Add test for cli
1 parent f176acb commit 333e346

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/cli/translate_cli_test.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import os
2+
from click.testing import CliRunner
3+
from honeybee_3dm.cli import translate_recipe
4+
from ladybug.futil import nukedir
5+
6+
7+
def test_write_hbjson():
8+
"""Check whether an HBJSON can be written."""
9+
runner = CliRunner()
10+
file_path = './tests/assets/test.3dm'
11+
config_path = './tests/assets/config.json'
12+
target_path = './tests/target'
13+
14+
result = runner.invoke(translate_recipe, [
15+
file_path, '--name', 'test', '--folder', target_path, '--config', config_path
16+
])
17+
18+
assert result.exit_code == 0
19+
hbjson_path = os.path.join(target_path, 'test.hbjson')
20+
assert os.path.isfile(hbjson_path)
21+
nukedir(target_path, True)

0 commit comments

Comments
 (0)