From bfe7dd16e9de1d2899d4915e85c1b15001517af7 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Sat, 11 Dec 2021 15:44:56 +0200 Subject: [PATCH] Reproduce the bug described in #1898 using test_addressbook() --- src/tests/test_api.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tests/test_api.py b/src/tests/test_api.py index 64f3fdbe..835b4afb 100644 --- a/src/tests/test_api.py +++ b/src/tests/test_api.py @@ -58,7 +58,8 @@ class TestAPI(TestAPIProto): _seed = base64.encodestring(sample_seed) def _add_random_address(self, label): - return self.api.createRandomAddress(base64.encodestring(label)) + addr = self.api.createRandomAddress(base64.encodestring(label)) + return addr def test_user_password(self): """Trying to connect with wrong username/password""" @@ -243,6 +244,15 @@ class TestAPI(TestAPIProto): entries['address'], sample_deterministic_addr4) self.assertEqual( base64.decodestring(entries['label']), 'tiger_4') + # Try sending to this address (#1898) + addr = self._add_random_address('random_2') + # TODO: it was never deleted + msg = base64.encodestring('test message') + msg_subject = base64.encodestring('test_subject') + result = self.api.sendMessage( + sample_deterministic_addr4, addr, msg_subject, msg) + self.assertNotRegexpMatches(result, r'^API Error') + self.api.deleteAddress(addr) # Remove known address self.api.deleteAddressBookEntry(sample_deterministic_addr4) # Addressbook should be empty again