We have moved to https://codeberg.org/fileTestSuite/fileTestSuite.py , grab new versions there.
Under the disguise of "better security" Micro$oft-owned GitHub has discriminated users of 1FA passwords while having commercial interest in success and wide adoption of FIDO 1FA specifications and Windows Hello implementation which it promotes as a replacement for passwords. It will result in dire consequencies and is competely inacceptable, read why.
If you don't want to participate in harming yourself, it is recommended to follow the lead and migrate somewhere away of GitHub and Micro$oft. Here is the list of alternatives and rationales to do it. If they delete the discussion, there are certain well-known places where you can get a copy of it. Read why you should also leave GitHub.
An implementation of fileTestSuite
spec for Python.
fileTestSuiteTool --help
Creates a boilerplate of meta.json
.
- Create a
meta.json
in a dir. fileTestSuiteTool convert meta.json
to convert into the binary representationfileTestSuiteTool convert meta.ftsmeta
to convert the binary representation back into JSON.
- Download a suite of test files. It can be a
git submodule
.
from fileTestSuite.unittest import withFTS
- Get path of the directory of the test suite:
thisDir = Path(__file__).resolve().absolute().parent
thisDir = thisDir / "testDataset"
- Create a test
class Tests(unittest.TestCase):
@withFTS(thisDir / "testDataset") # the decorator, that must be within a `TestCase`
def testProcessorImpl(self, challFile: Path, respFile: Path, paramsDict: typing.Optional[dict]=None) -> None: # the signature must be this one!
self._testChallengeResponsePair(challFile=challFile.read_bytes(), respFile=respFile.read_bytes(), paramsDict=paramsDict) # your function
Pros:
- each file corresponds to a test
- it nicely interoperates with
pytest
Cons:
- tests are loaded at class construction time.
from fileTestSuite.unittest import FileTestSuiteTestCaseMixin
- Create a test
class Tests(unittest.TestCase, FileTestSuiteTestCaseMixin):
@property
def fileTestSuiteDir(self) -> Path:
return thisDir / "testDataset"
def _testProcessorImpl(self, challFile: Path, respFile: Path, paramsDict: typing.Optional[dict]=None) -> None: # the signature must be this one! Note the underscore.
self._testChallengeResponsePair(challFile=challFile.read_bytes(), respFile=respFile.read_bytes(), paramsDict=paramsDict) # your function
Pros, cons: the inversion of ones of withFTS
.