From a1055a4c3f1a33f082251fe7b55cfade7bfa0aaa Mon Sep 17 00:00:00 2001 From: Henry Borchers Date: Tue, 3 Dec 2024 15:27:00 -0600 Subject: [PATCH] add initial test --- README.md | 9 +++++++++ pyproject.toml | 5 +++++ tests/test_qct_parse.py | 4 ++++ 3 files changed, 18 insertions(+) create mode 100644 tests/test_qct_parse.py diff --git a/README.md b/README.md index fb5de68..cdf03f8 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,15 @@ This repository contains scripts for automating analysis of QCTools reports. * Install Package `python -m pip install .` +### Test Code + +* Activate virtual env (see Install from source) +* Install pytest + `pip install pytest` +* Run tests + `python -m pytest` + + ### Scripts: - **`qct-parse`** diff --git a/pyproject.toml b/pyproject.toml index e7ee374..0de5939 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,3 +19,8 @@ qct-parse = "qct_parse.qct_parse:main" [tool.tox] envlist = ["3.9", "3.10", "3.11", "3.12", "3.13"] + +[tool.tox.env_run_base] +description = "Run test under {base_python}" +commands = [["pytest"]] +deps = ["pytest"] diff --git a/tests/test_qct_parse.py b/tests/test_qct_parse.py new file mode 100644 index 0000000..483d2c1 --- /dev/null +++ b/tests/test_qct_parse.py @@ -0,0 +1,4 @@ +from qct_parse import qct_parse + +def test_dts2ts(): + assert qct_parse.dts2ts("0.0330000") == '00:00:00.0330'