-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more testcases #1618
Add more testcases #1618
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1618 +/- ##
==========================================
+ Coverage 88.47% 88.50% +0.03%
==========================================
Files 17 17
Lines 2247 2254 +7
==========================================
+ Hits 1988 1995 +7
Misses 259 259
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The test for the family driver will be a useful addition.
It makes sense to test track_order
on the root group of a file, but I don't think we need to throw away the existing track_order
tests to add that; they're pretty well written as they are.
h5py/tests/test_group.py
Outdated
grp = self.f.create_group('b', track_order=True) | ||
self.f.create_group('a', track_order=True) | ||
self.f.create_group('c', track_order=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you scrap the .populate()
method? The numeric vs alphabetical ordering is a neat way to test this (2 < 10
but '10' < '2'
), and it was also checking that having a mixture of groups and datasets didn't interfere with the ordering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhh, the populate()
method is well designed, but not good for test_group, the existing bug have proved this, it is not a very straightforward way to show track_order feature for group, we should focus on testing root group and sub group, but not mixing group and dataset, so I propose to write it like this:
def populate(self, g, track_order):
for i in range(9,0,-1):
if i % 2 == 0:
self.f.create_group(str(i), track_order) # create root group
else:
g.create_group(str(i), track_order) # create sub group
@ut.expectedFailure
def test_track_order(self):
grp = self.f.create_group('0', track_order=True) # --->True
self.populate(grp, True) # --->True
expected = ['8', '6', '4', '2', '0']
# this will fail until issue 1577 fixed
self.assertEqual(list(self.f.keys(), expected))
expected = ['9', '7', '5', '3', '1']
self.assertEqual(list(grp.keys(), expected))
def test_no_track_order(self):
grp = self.f.create_group('0', track_order=False)
self.populate(grp, False)
expected = ['0', '2', '4', '6', '8']
self.assertEqual(list(self.f.keys(), expected))
expected = ['1', '3', '5', '7', '9']
self.assertEqual(list(grp.keys(), expected))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takluyver Ready for your review.
Major changes: