Adding tests for OpenPGP.

All tests are taken from gnuk. Reader is migrated from pyusb to pyscard.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-02-02 23:08:49 +01:00
parent 32868dfc31
commit 2c24c348b5
129 changed files with 6171 additions and 0 deletions

18
tests/conftest.py Normal file
View File

@@ -0,0 +1,18 @@
import pytest
from card_reader import get_ccid_device
from openpgp_card import OpenPGP_Card
def pytest_addoption(parser):
parser.addoption("--reader", dest="reader", type=str, action="store",
default="gnuk", help="specify reader: gnuk or gemalto")
@pytest.fixture(scope="session")
def card():
print()
print("Test start!")
reader = get_ccid_device()
card = OpenPGP_Card(reader)
card.cmd_select_openpgp()
yield card
del card
reader.ccid_power_off()