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
μ committed Sep 3, 2024
1 parent c560a46 commit b63fae3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/e2e_tests/subcommands/subnet/test_metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@

def test_metagraph_command(local_chain, capsys):
logging.info("Testing test_metagraph_command")
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(), "Subnet wasn't created successfully"
# 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(), f"Subnet {netuid+1} wasn't created successfully"

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

Expand Down

0 comments on commit b63fae3

Please sign in to comment.