decentralized-identity / keripy

Python Implementation of the KERI Core Libraries
Apache License 2.0
28 stars 10 forks source link

Implementation of KOM #152

Closed m00sey closed 3 years ago

m00sey commented 3 years ago

Addresses #147

Basic get/put/rem via a KOM based off a @dataclass

In addition to the KOM implementation I added coverage options.

These can be run:

coverage run -m pytest open htmlcov/index.html

SmithSamuelM commented 3 years ago

The tests are still expressed as methods of a class with self parameter but self is never used. The only reason to structure tests this way is if the class was being used to provide instance variables shared between tests. I suggest just put the tests at the top level as simple functions remove (self) and remove the class. Unlike Unittest which is class based pytest is perfectly happy with top level functions. The test module itself is a class and so can be used to provide shared values among the functions in the module without creating yet more classes. The contest.py file in the top level of the test direction allows test configuration that is shared globally. And similarly in each test package. So pytest uses packages and models to structure tests not classes. Its a different aesthetic and it took me a bit when I converted from Unittest to get how it worked.