Skip to content

Commit a3cd768

Browse files
authored
Refactor (#2)
* refactor webserver * unit tests
1 parent 669cb40 commit a3cd768

File tree

15 files changed

+727
-325
lines changed

15 files changed

+727
-325
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PYTHONPATH=src

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
__pycache__
22
.mypy_cache
33
.coverage
4-
htmlcov
4+
htmlcov
5+
wifi.dat

.justfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
run-test:
2-
pytest -svv
2+
PYTHONPATH=src pytest -svv
33
run-test-filter TEST:
4-
pytest -svv tests/*{{TEST}}*
4+
PYTHONPATH=src pytest -svv -k "{{TEST}}"
55
lint:
66
ruff format src tests
77
ruff check src tests --fix --exit-zero --line-length 100 --target-version py38
@@ -11,8 +11,9 @@ install-requirement:
1111
list:
1212
mpremote ls
1313
upload:
14-
mpremote cp src/main.py :main.py
15-
mpremote mkdir :diy_clock || echo "Directory already exists."
16-
mpremote cp src/diy_clock/*.py :diy_clock/
14+
mpremote mkdir :lib || echo "Directory already exists."
15+
mpremote cp src/wifi_manager/*.py :lib/wifi_manager/
16+
# just to check if the files are uploaded
17+
mpremote ls :lib/wifi_manager/
1718
mount_and_run:
1819
mpremote mount src/ run src/main.py

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"ruff.lint.enable": true,
1111
"ruff.lint.select": ["E501"],
1212
"python.testing.pytestArgs": [
13-
"src"
13+
"tests",
1414
],
15+
"python.envFile": "${workspaceFolder}/.env",
1516
"python.testing.unittestEnabled": false,
1617
"python.testing.pytestEnabled": true,
1718
"editor.fontSize": 14,

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
MIT License
22

3+
Copyright (c) 2025 Youngmin Kim
34
Copyright (c) 2021 Igor Ferreira
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy

pytest.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[pytest]
2-
pythonpath = src
2+
pythonpath = src
3+
addopts = -svv

src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from wifi_manager import WifiManager
1+
from wifi_manager.manager import WifiManager
22
import utime
33

44
# Example of usage

src/wifi_manager.py

Lines changed: 0 additions & 316 deletions
This file was deleted.

src/wifi_manager/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)