Skip to content

Commit 522be5c

Browse files
committed
Merge branch 'feature/code-coverage' into develop
2 parents f317d24 + 372d14c commit 522be5c

File tree

8 files changed

+24
-7
lines changed

8 files changed

+24
-7
lines changed

.github/workflows/pipeline.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ jobs:
5454
run: |
5555
mypy .
5656
57-
- name: Run unit tests
57+
- name: Run common security issue checker
5858
run: |
59-
pytest .
59+
bandit -c pyproject.toml -r .
60+
61+
- name: Run unit tests + code coverage
62+
run: |
63+
coverage run -m pytest .

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
__pycache__
22
*.egg-info
3+
.coverage
34
.mypy_cache
45
.pytest_cache
56
.ruff_cache

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
With pywaveshare, you can easily use the functionality of the [Waveshare GSM/GPRS/GNSS HAT for Raspberry Pi](https://www.waveshare.com/gsm-gprs-gnss-hat.htm). On this module a SIM868 Controller is doing the job to connect your Raspberry Pi with the world just by using a SIM card.
44

55
## Changelog
6-
[See this document.](https://github.com/acmacunlay/pywaveshare/blob/master/CHANGELOG.md)
6+
[See this document.](https://github.com/acmacunlay/pywaveshare/blob/main/CHANGELOG.md)
77

88
## Overview
99
pywaveshare was written for Python 3. It provides the following features
@@ -180,4 +180,4 @@ if gsm.UrlResponse_available() > 0:
180180

181181

182182
## License
183-
[See this document.](https://github.com/acmacunlay/pywaveshare/blob/master/LICENSE)
183+
[See this document.](https://github.com/acmacunlay/pywaveshare/blob/main/LICENSE)

pyproject.toml

+14-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,25 @@ classifiers = [
3838
]
3939

4040
[project.optional-dependencies]
41-
dev = ["build", "mypy", "pytest", "ruff", "setuptools", "twine"]
41+
dev = [
42+
"bandit",
43+
"build",
44+
"coverage",
45+
"mypy",
46+
"pytest",
47+
"ruff",
48+
"setuptools",
49+
"twine",
50+
]
4251

4352
[project.urls]
4453
Homepage = "https://github.com/acmacunlay/pywaveshare"
4554
Repository = "https://github.com/acmacunlay/pywaveshare.git"
46-
# TODO: Changelog = ""
55+
Changelog = "https://github.com/acmacunlay/pywaveshare/blob/main/CHANGELOG.md"
4756

4857
[[tool.mypy.overrides]]
4958
module = ["RPi", "RPi.GPIO", "serial"]
5059
ignore_missing_imports = true
60+
61+
[tool.bandit]
62+
exclude_dirs = ["tests", ".venv"]

src/pywaveshare/boards/sim868/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def __processData(self):
320320
rawData = match[0][1].split(",")
321321
self.__GPRSIPaddress = rawData[2].replace('"', "")
322322

323-
if self.__GPRSIPaddress != "0.0.0.0":
323+
if self.__GPRSIPaddress != "0.0.0.0": # nosec
324324
self.__GPRSready = True
325325
else:
326326
self.__GPRSready = False

tests/unit/boards/__init__.py

Whitespace-only changes.

tests/unit/boards/sim868/__init__.py

Whitespace-only changes.

tests/unit/boards/sim868/test_client.py

Whitespace-only changes.

0 commit comments

Comments
 (0)