Closed manfredlotz closed 3 years ago
Merging #19 (8882a78) into master (0779d2c) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #19 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 44 44
Branches 7 7
=========================================
Hits 44 44
Sorry, forgot to run make lint
You can reopen and push more commits to this pull request.
looking good, as per my comment above, would you be able to add test/tests for dumping as well as loading?
looking good, as per my comment above, would you be able to add test/tests for dumping as well as loading?
To be honest, it is not quite clear to me what to test here...
Well that the order of a dict is preserved when calling rtoml.dump()
When using rtoml.dump()
I have to compare to a string which as you (rightly) pointed out earlier is not really nice.
Well, it's just the inverse of the current test: here, the input is a dict and the output is a string. In this case the tests are actually more elegant as you don't have the case of comparing dicts.
Something like this?
def test_dumps_order(input_toml):
loaded = rtoml.load(input_toml)
assert input_toml == rtoml.dumps(loaded)
no, just:
def test_dumps_order(py_object, expected_toml):
assert rtoml.dumps(py_object) == expected_toml
Thanks so much for this.
I tweaked the tests a little. I'll make a new release now.
I'll make a new release now.
Done.
Thanks a lot!
I just did the following changes
preserve_order
totoml
crate inCargo.toml
tests/test_order.py