Skip to content

Commit

Permalink
Merge pull request #2198 from opentensor/test/gus/subnet-list-cmd-e2e
Browse files Browse the repository at this point in the history
test: subnet list e2e
  • Loading branch information
gus-opentensor authored Aug 6, 2024
2 parents 3a269ea + 8e2fe29 commit 0c4032e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/e2e_tests/subcommands/subnet/test_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import bittensor
from bittensor.commands import RegisterSubnetworkCommand
from tests.e2e_tests.utils import setup_wallet

"""
Test the list command before and after registering subnets.
Verify that:
* list of subnets gets displayed
-------------------------
* Register a subnets
* Ensure is visible in list cmd
"""


def test_list_command(local_chain, capsys):
# Register root as Alice
keypair, exec_command, wallet = setup_wallet("//Alice")

netuid = 0

assert local_chain.query("SubtensorModule", "NetworksAdded", [netuid]).serialize()

exec_command(RegisterSubnetworkCommand, ["s", "create"])

netuid - 1

# Verify subnet 1 created successfully
assert local_chain.query("SubtensorModule", "NetworksAdded", [netuid]).serialize()

0 comments on commit 0c4032e

Please sign in to comment.