Skip to content

Commit

Permalink
Add directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kleo-53 committed Sep 13, 2023
1 parent 4fa86b2 commit 7eb6367
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ jobs:

- name: Install pytest
run: pip install pytest

- name: Run tests
run: pytest pioneer_uploader.py
run:
export PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE
pytest

- name: Publish artifact
if: github.event_name == 'pull_request'
Expand Down
15 changes: 0 additions & 15 deletions test/test_uploader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from pathlib import Path

import pytest
import pioneer_uploader
from unittest.mock import patch
Expand All @@ -21,18 +19,5 @@ def test_few_arguments(mock_logging_error):
mock_logging_error.assert_called_once_with("Invalid arguments")


@patch("logging.error")
def test_correct_arguments(mock_logging_error):
current_file = Path(__file__).resolve()
file = current_file.parent/'test_file.lua'
print(file)
test_args = ["parameter", file, "127.0.0.1", "8888", "wifi"]
with patch('sys.argv', test_args):
with pytest.raises(ConnectionResetError):
pioneer_uploader.main()
# mock_logging_error.assert_called_once_with(ConnectionResetError(10054,
# 'An existing connection was forcibly closed by the remote host', None, 10054, None))


if __name__ == "__main__":
pytest.main()

0 comments on commit 7eb6367

Please sign in to comment.