Example #1
0
    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, "")
Example #2
0
 def test_invalid_unpickle(self):
     with pytest.raises(ValueError):
         Account.from_pickle(b"")
Example #3
0
 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)
Example #4
0
 def test_account_pickle(self):
     alice = Account()
     pickle = alice.pickle()
     assert (alice.identity_keys == Account.from_pickle(pickle)
             .identity_keys)