Skip to content

Commit

Permalink
test_metagraph.py: test adding multiple subnets and using netuid 2
Browse files Browse the repository at this point in the history
A minor tweak to the test that increases coverage of the test.
  • Loading branch information
μ authored and Reinier Heeres committed Aug 4, 2024
1 parent 923d7f1 commit 907f467
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/e2e_tests/subcommands/subnet/test_metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@


def test_metagraph_command(local_chain, capsys):
netuid = 1
# Register root as Alice
keypair, exec_command, wallet = setup_wallet("//Alice")
exec_command(RegisterSubnetworkCommand, ["s", "create"])

# Verify subnet <netuid> created successfully
assert local_chain.query("SubtensorModule", "NetworksAdded", [netuid]).serialize()
# The rest of the test will use subnet 2
netuid = 2

for i in range(netuid):
# Register subnet <i+1>
exec_command(RegisterSubnetworkCommand, ["s", "create"])
# Verify subnet <i+1> created successfully
assert local_chain.query(
"SubtensorModule", "NetworksAdded", [i + 1]
).serialize()

subtensor = bittensor.subtensor(network="ws://localhost:9945")

Expand Down

0 comments on commit 907f467

Please sign in to comment.