Closed kurtmckee closed 1 month ago
The low level ReaderGroups PC/SC functions are available only on Windows.
On Unix they just return SCARD_E_UNSUPPORTED_FEATURE
. See c40ce544d8859211d948704ec33d142184365e6b
What system do you use to run your tests?
I'm currently working on Linux. However, the readergroups
tests here are not touching the PCSC reader groups code; they exercise the readergroups
class that establishes the API contract that the PCSC reader groups class relies on / overrides.
Merged in 0c2c269cc7526ddb9a8fbd4bc5cce0b45c2c5f3e
Thanks
pylint reports an error:
pylint test/test_readergroups.py
************* Module test_readergroups
test/test_readergroups.py:57:18: E1135: Value 'reader_group.instance' doesn't support membership test (unsupported-membership-test)
I don't recommend checking the test suite with pylint or mypy -- test suites may exercise invalid types, invalid operations, and other things that those two linters will get upset about unnecessarily.
However, if you want to target the test suite with pylint, that needs to go into tox.ini
so it's getting checked consistently, and then I can design around that.
Valid point. Ignore my comment.
This PR introduces extensive testing of the
readergroups
class, and achieves 100% test coverage of the file.However,
readergroups
has pathological implementation problems, which are captured in the tests marked withxfail
or that usepytest.raises()
to capture failures:readergroups.addreadergroup()
causes aRecursionError
readergroups.removereadergroup()
causes aValueError
readergroups.getreadergroups()
returns a hard-coded empty listThere is at least one side effect I've found when
readergroups
is inherited by the PSCS reader groups subclass, but I haven't added those tests yet.Now that the problems are captured in the test suite, I intend to work to remove the
readergroups
class entirely.