def test_unknown_language(): with pytest.raises(ValidationError, match="Invalid language choice.*"): Account.create_with_mnemonic(language="pig latin")
def test_bad_account_path2(): with pytest.raises(ValidationError, match="Path.*is not valid.*"): Account.create_with_mnemonic(account_path='m/not/an/account/path')
def test_bad_passphrase(): a1, mnemonic = Account.create_with_mnemonic(passphrase="My passphrase") a2 = Account.from_mnemonic(mnemonic, passphrase="Not my passphrase") assert a1.address != a2.address
def test_incorrect_num_words(): with pytest.raises(ValidationError, match="Invalid choice for number of words.*"): Account.create_with_mnemonic(num_words=11)
def test_account_restore(): a1, mnemonic = Account.create_with_mnemonic(num_words=24, passphrase="TESTING") a2 = Account.from_mnemonic(mnemonic, passphrase="TESTING") assert a1.address == a2.address