diff --git a/test/validation/items/common/helper_lib.py b/test/validation/items/common/helper_lib.py new file mode 100644 index 0000000..dba98b7 --- /dev/null +++ b/test/validation/items/common/helper_lib.py @@ -0,0 +1,29 @@ +import libs.testium as libtm + + +def check_os(expected_os): + result = libtm.OS() + assert result == expected_os, f"Expected {expected_os!r}, got {result!r}" + return 0 + + +def check_get_main_dir(): + d = libtm.get_main_dir() + assert isinstance(d, str) and len(d) > 0 + return 0 + + +def check_timestamp_as_sec_conversion(): + assert libtm.timestamp_as_sec(0) == 0.0 + assert libtm.timestamp_as_sec(10000) == 1.0 + assert libtm.timestamp_as_sec(5000) == 0.5 + return 0 + + +def check_timestamp(): + libtm.init_timestamp() + t = libtm.timestamp() + assert isinstance(t, int) and t >= 0 + ts = libtm.timestamp_as_sec() + assert isinstance(ts, float) and ts >= 0.0 + return 0 diff --git a/test/validation/items/common/test.tum b/test/validation/items/common/test.tum index fe5f458..8900f7c 100644 --- a/test/validation/items/common/test.tum +++ b/test/validation/items/common/test.tum @@ -9,4 +9,29 @@ - group: name : Various syntax robustness steps: - - !include syntax_robustness/test.tum \ No newline at end of file + - !include syntax_robustness/test.tum +- group: + name: Helper lib functions + steps: + - py_func: + name: OS + key: $(test)_PASS + file: $(test_path)$(psep)helper_lib.py + func_name: check_os + param: + - $(os) + - py_func: + name: get_main_dir + key: $(test)_PASS + file: $(test_path)$(psep)helper_lib.py + func_name: check_get_main_dir + - py_func: + name: timestamp_as_sec conversion + key: $(test)_PASS + file: $(test_path)$(psep)helper_lib.py + func_name: check_timestamp_as_sec_conversion + - py_func: + name: timestamp and timestamp_as_sec + key: $(test)_PASS + file: $(test_path)$(psep)helper_lib.py + func_name: check_timestamp \ No newline at end of file