-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2198 from opentensor/test/gus/subnet-list-cmd-e2e
test: subnet list e2e
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |