Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace print with logger #76

Merged
merged 61 commits into from
Aug 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b1ea793
Replace print with logger
wwakabobik Oct 10, 2023
07ed7b2
Merge branch 'master' of github.com:wwakabobik/testrail_api_reporter …
wwakabobik Nov 1, 2023
012e259
Merge branch 'master' of github.com:wwakabobik/testrail_api_reporter …
wwakabobik Jan 16, 2024
61f4625
Merge branch 'master' of github.com:wwakabobik/testrail_api_reporter …
wwakabobik Jan 16, 2024
35fd93c
Merge branch 'master' of github.com:wwakabobik/testrail_api_reporter …
wwakabobik Jan 30, 2024
5aba820
Update to 1.4.10
wwakabobik Mar 12, 2024
cd26d29
Update to 1.4.11
wwakabobik Mar 12, 2024
85783db
Update to 1.4.11
wwakabobik Mar 12, 2024
a53f87b
Update to 1.4.11
wwakabobik Mar 12, 2024
cb9c5ea
Update to 1.4.11
wwakabobik Mar 12, 2024
6014d5d
Update to 1.4.11
wwakabobik Mar 12, 2024
3e40db3
Update to 1.4.11
wwakabobik Mar 12, 2024
a9d4f2e
Update to 1.4.11
wwakabobik Mar 12, 2024
9225b41
Update to 1.4.11
wwakabobik Mar 27, 2024
905fb75
Update to 1.4.11
wwakabobik Mar 27, 2024
5efcc7b
Re-sort requirements.txt
wwakabobik Aug 19, 2024
cfa0860
Update GA and README.md
wwakabobik Aug 19, 2024
55b9741
Update GA and README.md
wwakabobik Aug 19, 2024
e6306dd
Update GA and README.md
wwakabobik Aug 19, 2024
2bd3be4
Update GA and README.md
wwakabobik Aug 19, 2024
cee07b6
Rearrange project structure, add tests for upload_image
wwakabobik Aug 19, 2024
a223c00
Rearrange project structure, add tests for upload_image
wwakabobik Aug 19, 2024
e4b2809
Rearrange project structure, add tests for upload_image
wwakabobik Aug 19, 2024
ff2c5aa
Fix linters
wwakabobik Aug 19, 2024
39f838a
Fix linters
wwakabobik Aug 19, 2024
abdfbc0
Fix linters
wwakabobik Aug 19, 2024
9c34087
Fix linters
wwakabobik Aug 19, 2024
862ab68
Fix linters
wwakabobik Aug 19, 2024
62a5b6d
Fix linters
wwakabobik Aug 19, 2024
94e94be
Fix linters
wwakabobik Aug 19, 2024
7915a6a
Add test_reporter_utils_delete_file.py
wwakabobik Aug 20, 2024
6e87fe5
Add test_reporter_utils_delete_file.py
wwakabobik Aug 20, 2024
fd0a0f2
100% cover "reporter_utils"
wwakabobik Aug 20, 2024
a3c5d2e
100% cover "reporter_utils"
wwakabobik Aug 20, 2024
5e98c3e
100% cover "reporter_utils"
wwakabobik Aug 20, 2024
65b4190
100% cover "reporter_utils"
wwakabobik Aug 20, 2024
ae97ade
Add explicit coding (utf-8)
wwakabobik Aug 20, 2024
c66bbe5
Added test_reporter_utils_case_stat.py
wwakabobik Aug 29, 2024
3674308
Added test_reporter_utils_csv_parser_*.py
wwakabobik Aug 29, 2024
86becd9
Added test_reporter_utils_logger_config.py
wwakabobik Aug 29, 2024
f5e64ae
Added test_engines_plotly_reporter_draw_automation_state_report.py
wwakabobik Aug 30, 2024
9e64152
Added test_engines_plotly_reporter_draw_test_case_by_area.py
wwakabobik Aug 30, 2024
ea283cb
Added test_engines_plotly_reporter_draw_test_case_by_priority.py.py
wwakabobik Aug 30, 2024
2f88ebb
Variate more params for draw functions
wwakabobik Aug 30, 2024
bfa4b8b
Add test_engines_plotly_reporter_draw_history_state_chart.py
wwakabobik Aug 30, 2024
965c8b9
Fix test against missed filename
wwakabobik Aug 30, 2024
6c247c2
Linter fixes
wwakabobik Aug 30, 2024
8b50e52
Linter fixes
wwakabobik Aug 30, 2024
44a1c63
Linter fixes
wwakabobik Aug 30, 2024
7d3510b
Linter fixes
wwakabobik Aug 30, 2024
331153c
Add explicit coding (utf-8)
wwakabobik Aug 30, 2024
736c445
Linter fixes
wwakabobik Aug 30, 2024
3a1d559
Linter fixes
wwakabobik Aug 30, 2024
d299bee
Linter fixes
wwakabobik Aug 30, 2024
e218cdd
Linter fixes
wwakabobik Aug 30, 2024
6921143
Linter fixes
wwakabobik Aug 30, 2024
a80d528
Linter fixes
wwakabobik Aug 30, 2024
4105b4b
Merge branch 'master' of github.com:wwakabobik/testrail_api_reporter …
wwakabobik Aug 30, 2024
acda84c
Fix readme file
wwakabobik Aug 30, 2024
02d5423
Merge branch 'master' of github.com:wwakabobik/testrail_api_reporter …
wwakabobik Aug 30, 2024
2b59c2d
Update README.txt
wwakabobik Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test_reporter_utils_delete_file.py
wwakabobik committed Aug 20, 2024
commit 7915a6a2ec4a8fdf0dd8b5e2077d73a054f5d536
44 changes: 44 additions & 0 deletions tests/utils/test_reporter_utils_delete_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""Tests for the reporter_utils module, function 'delete_file'"""

import os
from unittest.mock import MagicMock

from testrail_api_reporter.utils.reporter_utils import delete_file # pylint: disable=import-error,no-name-in-module


def test_delete_file():
"""Test delete file"""
test_file = "test_file.txt"
with open(test_file, "w") as file:
file.write("Test")

assert os.path.exists(test_file) is True
delete_file(test_file, debug=False)

assert os.path.exists(test_file) is False


def test_delete_file_with_debug():
"""Test delete file with debug output"""
test_file = "test_file.txt"
with open(test_file, "w") as file:
file.write("Test")

assert os.path.exists(test_file) is True
mock_logger = MagicMock()
delete_file(test_file, debug=True, logger=mock_logger)

assert os.path.exists(test_file) is False
mock_logger.debug.assert_called_once_with(f"Removed {test_file}")


def test_delete_file_non_existent(capfd):
"""
Test delete non-existing file
:param capfd - fixture of cap failure logger
"""
delete_file("non_existent_file.txt", debug=True)
out, err = capfd.readouterr()

assert "No such file or directory" in err