-
Notifications
You must be signed in to change notification settings - Fork 7
/
test_cli.py
34 lines (25 loc) · 1.18 KB
/
test_cli.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
"""Tests for AugmentedNet.cli."""
import unittest
from AugmentedNet import cli
class TestCli(unittest.TestCase):
def test_base_argument_names(self):
argsGT = set(cli.DefaultArguments.base.keys())
args = set(vars(cli._base().parse_args([])))
self.assertEqual(args, argsGT)
def test_tsv_argument_names(self):
argsGT = set(cli.DefaultArguments.tsv.keys())
args = set(vars(cli.tsv().parse_args([])))
parentArgs = set(vars(cli._base().parse_args([])))
self.assertEqual(args - parentArgs, argsGT)
def test_npz_argument_names(self):
argsGT = set(cli.DefaultArguments.npz.keys())
args = set(vars(cli.npz().parse_args([])))
parentArgs = set(vars(cli._base().parse_args([])))
self.assertEqual(args - parentArgs, argsGT)
def test_train_argument_names(self):
argsGT = set(cli.DefaultArguments.train.keys())
args = set(vars(cli.train().parse_args(["debug", "cli"])))
parentArgs = set(vars(cli.npz().parse_args([])))
positional = {"experiment_name", "run_name"}
self.assertEqual(args - parentArgs - positional, argsGT)
# TODO: Validate structure of a default json file