Unverified Commit 199365e8 by René Helmke Committed by GitHub

Merge pull request #22 from fkie-cad/github-test-action

added github action for tests
parents f35022e1 731e4d43
name: Run Tests
on: [pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install deps
run: |
python3 -m pip install -U pip
python3 -m pip install .
python3 -m pip install -r requirements-dev.txt
- name: run pytest
run: pytest
...@@ -7,7 +7,7 @@ def test_get_file_type_system_magic(): ...@@ -7,7 +7,7 @@ def test_get_file_type_system_magic():
zip_file = Path(__file__).parent.parent / 'data' / 'test.zip' zip_file = Path(__file__).parent.parent / 'data' / 'test.zip'
file_type = get_file_type_from_path(str(zip_file)) file_type = get_file_type_from_path(str(zip_file))
assert file_type['mime'] == 'application/zip', 'mime type not correct' assert file_type['mime'] == 'application/zip', 'mime type not correct'
assert file_type['full'].startswith('Zip archive data, at least v2.0 to extract'), 'full type not correct' assert file_type['full'].startswith('Zip archive data, at least'), 'full type not correct'
assert file_type == get_file_type_from_binary(zip_file.read_bytes()) assert file_type == get_file_type_from_binary(zip_file.read_bytes())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment