From 9f34a8f3ed6f26e65b7a1cc0f5a96ca668332724 Mon Sep 17 00:00:00 2001 From: smilesun Date: Tue, 2 Jul 2024 16:39:36 +0200 Subject: [PATCH 1/2] unit test for mldg, dial, dann, diva composition, if gamma is set correctly --- tests/test_composite_reg_cmd.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/test_composite_reg_cmd.py diff --git a/tests/test_composite_reg_cmd.py b/tests/test_composite_reg_cmd.py new file mode 100644 index 000000000..c314a5551 --- /dev/null +++ b/tests/test_composite_reg_cmd.py @@ -0,0 +1,19 @@ +""" +Test argparser functionality +""" +import os +from domainlab.arg_parser import mk_parser_main +from domainlab.exp.exp_main import Exp + + +def test_parse_yml_args(): + """Test argparser with yaml file""" + testdir = os.path.dirname(os.path.realpath(__file__)) + rootdir = os.path.join(testdir, "..") + rootdir = os.path.abspath(rootdir) + file_path = os.path.join(rootdir, "examples/conf/vlcs_diva_mldg_dial.yaml") + argsstr = "--config=" + file_path + parser = mk_parser_main() + margs = parser.parse_args(argsstr.split()) + exp = Exp(margs) + exp.execute() From 062066946396982775553000d667c4df9df51f2c Mon Sep 17 00:00:00 2001 From: Xudong Sun Date: Sat, 13 Jul 2024 01:49:11 +0200 Subject: [PATCH 2/2] Update test_composite_reg_cmd.py --- tests/test_composite_reg_cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_composite_reg_cmd.py b/tests/test_composite_reg_cmd.py index c314a5551..5224345cd 100644 --- a/tests/test_composite_reg_cmd.py +++ b/tests/test_composite_reg_cmd.py @@ -10,7 +10,7 @@ def test_parse_yml_args(): """Test argparser with yaml file""" testdir = os.path.dirname(os.path.realpath(__file__)) rootdir = os.path.join(testdir, "..") - rootdir = os.path.abspath(rootdir) + # rootdir = os.path.abspath(rootdir) file_path = os.path.join(rootdir, "examples/conf/vlcs_diva_mldg_dial.yaml") argsstr = "--config=" + file_path parser = mk_parser_main()