Skip to content
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

test: subnet list e2e #2198

Merged
merged 4 commits into from
Aug 6, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")

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

subnets = subtensor.get_subnets()

assert len(subnets) == 2

exec_command(RegisterSubnetworkCommand, ["s", "create"])
# Verify subnet 1 created successfully
subnets = subtensor.get_subnets()
assert len(subnets) == 3
Loading