Skip to content
Open
Changes from all 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
17 changes: 9 additions & 8 deletions contrib/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ import bittensor

def test_some_functionality():
# Setup any necessary objects or state.
wallet = bittensor.Wallet()

# Call the function you're testing.
result = wallet.create_new_coldkey()

# Assert that the function behaved as expected.
assert result is not None
wallet = bittensor.Wallet(name="test_wallet", hotkey="test_hotkey")

# Create a new coldkey with required parameters
wallet.create_new_coldkey(use_password=False, overwrite=True)

# Assert that the wallet was created successfully
assert wallet.coldkey is not None
assert wallet.coldkeypub is not None
```

In this example, we're testing the `create_new_coldkey` function of the `wallet` object. We assert that the result is not `None`, which is the expected behavior.
In this example, we're testing the wallet creation functionality. We create a wallet with a name and hotkey, then create a new coldkey with the required parameters. The `use_password=False` parameter disables password protection for testing purposes, and `overwrite=True` allows overwriting existing keys.

## Mocking

Expand Down
Loading