test ci and fix #125
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
name: tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request_target:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest # ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
# os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
||||||
|
|
||||||
|
env:
|
||||||
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U pip numpy cython mypy
|
||||||
|
pip install -U pytest codecov pytest-cov
|
||||||
|
pip install .
|
||||||
|
|
||||||
|
# - name: Type checking
|
||||||
|
# run: |
|
||||||
|
# mypy pyModeS tests
|
||||||
|
|
||||||
|
- name: Run tests (without Cython)
|
||||||
|
run: |
|
||||||
|
pytest tests --cov --cov-report term-missing
|
||||||
|
|
||||||
|
- name: Install with Cython
|
||||||
|
run: |
|
||||||
|
pip install -U cython
|
||||||
|
pip install --force-reinstall .
|
||||||
|
|
||||||
|
- name: Run tests (with Cython)
|
||||||
|
run: |
|
||||||
|
pytest tests
|
||||||
|
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
if: ${{ github.event_name != 'pull_request_target' && env.PYTHON_VERSION == '3.10' }}
|
||||||
|
uses: codecov/codecov-action@v2
|
||||||
|
with:
|
||||||
|
env_vars: PYTHON_VERSION
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# noqa
|
||||||
|
|
||||||
"""ADS-B module.
|
"""ADS-B module.
|
||||||
|
|
||||||
The ADS-B module also imports functions from the following modules:
|
The ADS-B module also imports functions from the following modules:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ def is20(msg):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
# allow empty callsign
|
# allow empty callsign
|
||||||
if common.bin2int(d[8:56]) == 0
|
if common.bin2int(d[8:56]) == 0:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if "#" in cs20(msg):
|
if "#" in cs20(msg):
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
|||||||
|
|
||||||
details = dict(
|
details = dict(
|
||||||
name="pyModeS",
|
name="pyModeS",
|
||||||
version="2.10",
|
version="2.10.1",
|
||||||
description="Python Mode-S and ADS-B Decoder",
|
description="Python Mode-S and ADS-B Decoder",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
url="https://github.com/junzis/pyModeS",
|
url="https://github.com/junzis/pyModeS",
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ def test_adsb_target_state_status():
|
|||||||
sel_alt = adsb.selected_altitude("8DA05629EA21485CBF3F8CADAEEB")
|
sel_alt = adsb.selected_altitude("8DA05629EA21485CBF3F8CADAEEB")
|
||||||
assert sel_alt == (16992, "MCP/FCU")
|
assert sel_alt == (16992, "MCP/FCU")
|
||||||
assert adsb.baro_pressure_setting("8DA05629EA21485CBF3F8CADAEEB") == 1012.8
|
assert adsb.baro_pressure_setting("8DA05629EA21485CBF3F8CADAEEB") == 1012.8
|
||||||
assert adsb.selected_heading("8DA05629EA21485CBF3F8CADAEEB")== 66.8
|
assert adsb.selected_heading("8DA05629EA21485CBF3F8CADAEEB") == 66.8
|
||||||
assert adsb.autopilot("8DA05629EA21485CBF3F8CADAEEB") == True
|
assert adsb.autopilot("8DA05629EA21485CBF3F8CADAEEB") == True
|
||||||
assert adsb.vnav_mode("8DA05629EA21485CBF3F8CADAEEB") == True
|
assert adsb.vnav_mode("8DA05629EA21485CBF3F8CADAEEB") == True
|
||||||
assert adsb.altitude_hold_mode("8DA05629EA21485CBF3F8CADAEEB") == False
|
assert adsb.altitude_hold_mode("8DA05629EA21485CBF3F8CADAEEB") == False
|
||||||
|
|||||||
Reference in New Issue
Block a user