def test_wrong_passphrase_pickle(self): alice = Account() passphrase = "It's a secret to everybody" pickle = alice.pickle(passphrase) with pytest.raises(OlmAccountError): Account.from_pickle(pickle, "")
def test_invalid_unpickle(self): with pytest.raises(ValueError): Account.from_pickle(b"")
def test_passphrase_pickle(self): alice = Account() passphrase = "It's a secret to everybody" pickle = alice.pickle(passphrase) assert (alice.identity_keys == Account.from_pickle( pickle, passphrase).identity_keys)
def test_account_pickle(self): alice = Account() pickle = alice.pickle() assert (alice.identity_keys == Account.from_pickle(pickle) .identity_keys)