bittensor
bittensor copied to clipboard
Tests for metagraph, highlighting bug
Bug
The e2e test that tests metagraph has some flaws. Some assertions don't work as intended and a bug in metagraph is not caught. While I was at it I fixed some low hanging fruit, that is, some fragile constructions that may turn into bugs later on.
Description of the Change
- don't split lines, assert particular strings in complete output so specific line number doesn't matter
- fix
assert 'a' and 'b' in sas it doesn't test whether both'a'and'b'are ins - replace magic constant
1withnetuid - create an additional subnet to make the test coverage broader
- test
.save()and.load()on metagraph
note that the last test fails, but that is due to a bug in bittensor that has to be solved. This PR demonstrates there is a bug, and provides a test to see whether a (to be written) fix solves the bug.
Alternate Designs
Not relevant.
Possible Drawbacks
N/A
Verification Process
By doing metagraph_pre_dave = subtensor.metagraph(netuid=netuid) instead of metagraph_pre_dave.load() it was verified that the assertions comparing distinct metagraph objects should work, if the metagraphs are in sync.
Release Notes
N/A