generated from a-parida12/poetry_pypi_template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(multiple) : adding tests to the main
* build: rename package name and pyproject toml * docs: modified name in license * 11 modify the module name from dcm anon to dcm anon (#17) * fix(modulename): update to dcm_anon * added a dummy test to ci pipeline * test: Added stubs for missing tests * refactor: Modified date and time from datetime more library based than using string manipulation * test: added tests for datetime after modifying datetime but tests dont run on local * test: added type annotation * build: added dicom_Csv and corrected imports tests now run * test: added tests for hash and datetime * test: added tests for utils * build: rename package name and pyproject toml * docs: modified name in license * 11 modify the module name from dcm anon to dcm anon (#17) * fix(modulename): update to dcm_anon * added a dummy test to ci pipeline * test: Added stubs for missing tests * refactor: Modified date and time from datetime more library based than using string manipulation * test: added tests for datetime after modifying datetime but tests dont run on local * test: added type annotation * build: added dicom_Csv and corrected imports tests now run * test: added tests for hash and datetime * refactor: Made relative imports * test: added tests for hash and datetime * build: rename package name and pyproject toml * docs: modified name in license * 11 modify the module name from dcm anon to dcm anon (#17) * fix(modulename): update to dcm_anon * added a dummy test to ci pipeline * test: Added stubs for missing tests * refactor: Modified date and time from datetime more library based than using string manipulation * test: added tests for datetime after modifying datetime but tests dont run on local * test: added type annotation * build: added dicom_Csv and corrected imports tests now run * test: added tests for hash and datetime * refactor: Made relative imports * refactor: made change to datetime * test: added tests for datetime * test: added tests for utils * build: rename package name and pyproject toml * docs: modified name in license * 11 modify the module name from dcm anon to dcm anon (#17) * fix(modulename): update to dcm_anon * added a dummy test to ci pipeline * test: Added stubs for missing tests * refactor: Modified date and time from datetime more library based than using string manipulation * test: added tests for datetime after modifying datetime but tests dont run on local * test: added type annotation * build: added dicom_Csv and corrected imports tests now run * test: added tests for hash and datetime * test: added tests for hash and datetime * build: rename package name and pyproject toml * docs: modified name in license * 11 modify the module name from dcm anon to dcm anon (#17) * fix(modulename): update to dcm_anon * added a dummy test to ci pipeline * test: Added stubs for missing tests * refactor: Modified date and time from datetime more library based than using string manipulation * test: added tests for datetime after modifying datetime but tests dont run on local * test: added type annotation * build: added dicom_Csv and corrected imports tests now run * test: added tests for hash and datetime * refactor: Made relative imports * changed datetime (#21) * build: rename package name and pyproject toml * docs: modified name in license * test: Added stubs for missing tests * refactor: Modified date and time from datetime more library based than using string manipulation * test: added tests for datetime after modifying datetime but tests dont run on local * test: added type annotation * build: added dicom_Csv and corrected imports tests now run * test: added tests for hash and datetime * refactor: Made relative imports * refactor: made change to datetime * test: added test stubs for dcm.py * test: Added test for reading dicom --------- Co-authored-by: Abhijeet Parida <abhijeet.parida@tum.de>
- Loading branch information
1 parent
88123ec
commit a6e0e9d
Showing
18 changed files
with
297 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# add root-dir to sys path for tests | ||
import sys | ||
import pytest | ||
from os.path import abspath | ||
from os.path import dirname as d | ||
|
||
parent_dir = f"{d(d(abspath(__file__)))}" | ||
sys.path.append(parent_dir) | ||
|
||
print(parent_dir) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,79 @@ | ||
# import pytest | ||
import pytest | ||
from dcm_anon.utils.datetime import get_datetime, get_date, get_time | ||
from dcm_anon.utils.hash import encrypt_string, get_digits, get_non_digits | ||
from dcm_anon.utils.dcm import check_valid_dcm # , bare_bones_ui, get_dicom_csv | ||
|
||
# from hapy_pypi import bool_val | ||
|
||
# @pytest.mark.base | ||
# def test_00_1_base_test(): | ||
# assert type(bool_val) == bool | ||
# assert bool_val == True | ||
@pytest.fixture | ||
def tests_data(): | ||
yield "./tests/data/" | ||
|
||
|
||
@pytest.mark.utils | ||
def test_get_datetime() -> None: | ||
dt_string = get_datetime() | ||
assert type(dt_string) == str | ||
assert len(dt_string) == 14 | ||
|
||
|
||
@pytest.mark.utils | ||
def test_get_date() -> None: | ||
date = get_date() | ||
assert type(date) == str | ||
assert len(date) == 8 | ||
|
||
|
||
@pytest.mark.utils | ||
def test_get_time() -> None: | ||
time = get_time() | ||
assert type(time) == str | ||
assert len(time) == 6 | ||
|
||
|
||
@pytest.mark.utils | ||
def test_encrypt_string() -> None: | ||
test_string = "test_string" | ||
hash = encrypt_string(test_string) | ||
hex_value = "4b641e9a923d1ea57e18fe41dcb543e2c4005c41ff210864a710b0fbb2654c11" | ||
assert hash == hex_value | ||
|
||
|
||
@pytest.mark.utils | ||
def test_get_digits() -> None: | ||
test_string = "1a2b3c" | ||
op = get_digits(test_string) | ||
assert op == "123" | ||
assert type(op) == str | ||
|
||
|
||
@pytest.mark.utils | ||
def test_get_non_digits() -> None: | ||
test_string = "1a2b3c" | ||
op = get_non_digits(test_string) | ||
assert op == "abc" | ||
assert type(op) == str | ||
|
||
|
||
@pytest.mark.utils | ||
def test_check_valid_dcm(tests_data): | ||
dicom_file = tests_data + "test1" | ||
assert check_valid_dcm(dicom_file) is True | ||
|
||
dicom_file = tests_data + "test2" | ||
assert check_valid_dcm(dicom_file) is True | ||
|
||
|
||
@pytest.mark.utils | ||
def test_check_invalid_dcm(tests_data): | ||
file = tests_data + "test_dcm.txt" | ||
assert check_valid_dcm(file) is False | ||
|
||
|
||
@pytest.mark.utils | ||
def test_bare_bones_ui(): | ||
pass | ||
|
||
|
||
@pytest.mark.utils | ||
def test_get_dicom_csv(): | ||
pass |