easysettings
easysettings copied to clipboard
Allow `set` and `save` to be chained
Resolves #11
What I did
- [x] Modified the settings base class to
return self
on bothset()
andsave()
, allowing these two methods to be chained as an alternative tosetsave()
- [x] Added a new test case to ensure that
set().save()
works as expected - [x] Also, I added a new test case to the base settings tests to make the same check for
setsave()
- [x] Fixed
setsave()
calls inYAMLSettings
andTOMLSettings
, as well as inJSONSettings
, since they weren't passing theoption
andvalue
arguments to thesuper
call. This was uncovered after adding the test forsetsave
mentioned above.
At this point I haven't removed the setsave
method (in case it should remain for compatibility reasons), and I haven't (yet) made any changes to the README, changelog or docs, but I could do if needed!
How to test
I added two new tests to test_settingsbase
, all tests should pass with pytest