Skip to content

Commit

Permalink
adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
j-z10 committed Mar 26, 2024
1 parent 595db67 commit 2190b25
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 12 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install GmSSL dependencies
run: |
git clone https://github.com/guanzhi/GmSSL.git
cd GmSSL && git checkout tags/v3.1.1
Expand All @@ -32,18 +32,17 @@ jobs:
sudo ldconfig
gmssl version
cd ../../
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install Python dependencies
run: |
python -m pip install poetry
poetry install --sync --with dev
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 ./src --count --exit-zero
- name: Test with pytest
run: |
pytest -v --cov pygmssl
pytest -v --cov src/pygmssl
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
Expand Down
84 changes: 83 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ autopep8 = "^2.1.0"
isort = "^5.13.2"
flake8 = "^7.0.0"
pytest = "^8.1.1"
pytest-cov = "^5.0.0"

[build-system]
requires = ["poetry-core"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ def test_private_pem_export_and_import(self):

assert new_obj.pub_key != b'\x00' * 64
assert new_obj.pub_key == obj.pub_key

def test_pub_pem_export_and_import(self):
obj = SM2.generate_new_pair()
assert obj.pub_key != b'\x00' * 64
assert obj.pri_key != b'\x00' * 32
new_obj = SM2.import_public_from_pem(obj.export_public_key_to_pem())
assert new_obj.pri_key == b'\x00' * 32
assert new_obj.pub_key != b'\x00' * 64
assert new_obj.pub_key == obj.pub_key
assert new_obj.pub_key == obj.pub_key

0 comments on commit 2190b25

Please sign in to comment.