gmr / flatdict

Python module for interacting with nested dicts as a single level dict with delimited keys.
https://flatdict.readthedocs.io
BSD 3-Clause "New" or "Revised" License
112 stars 32 forks source link

Implement __eq__ called in unittest.assertDictEqual. Fix unit tests. #13

Closed arm77 closed 6 years ago

arm77 commented 7 years ago

Tests are calling unittest.assertDictEqual but not implementing eq/ne. Fixed failing tests.

codecov-io commented 7 years ago

Codecov Report

Merging #13 into master will increase coverage by 0.08%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
+ Coverage   96.29%   96.38%   +0.08%     
==========================================
  Files           1        1              
  Lines         162      166       +4     
==========================================
+ Hits          156      160       +4     
  Misses          6        6
Impacted Files Coverage Δ
flatdict.py 96.38% <100%> (+0.08%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 523a293...3f54e29. Read the comment docs.

gmr commented 6 years ago

Looks like a good addition, but I'm curious why you're nuking the test data that intentionally was setup with a different delimiter.

arm77 commented 6 years ago

The test was failing due to the different delimiter on my machine.

In the first and second blocks of 3f54e29, the key "foo" is causing the test to fail. In the second and third blocks I changed the delimiter from : to - since the data before it had a delimiter - otherwise the test fails. It looked like the previous commit to this file was a careless copy/paste job.

gmr commented 6 years ago

Thanks for this. I picked your new functionality and added it to the class and just pushed the next version to master. Sorry for not merging directly.

I ended up rewriting a majority of the tests. If you're so inclined, please take a look at the changes that just landed in master for v2.

arm77 commented 6 years ago

Looks good. I always try to implement eq so you can compare using ==