completing
authorVolker Birk <vb@pep.foundation>
Fri, 05 Jan 2018 22:13:54 +0100
changeset 23616c6698ef4e34
parent 2360 3b8abacf96ce
child 2362 54b3fb347ca2
completing
test/python_tests/test_handshake.py
     1.1 --- a/test/python_tests/test_handshake.py	Fri Jan 05 22:01:06 2018 +0100
     1.2 +++ b/test/python_tests/test_handshake.py	Fri Jan 05 22:13:54 2018 +0100
     1.3 @@ -46,10 +46,10 @@
     1.4          pEp.update_identity(i)
     1.5          return i
     1.6  
     1.7 -    def test_send_and_recv_message(self):
     1.8 +    def test_handshake(self):
     1.9          setup_gnupg() ; import pEp
    1.10  
    1.11 -        msg = pEp.Message()
    1.12 +        msg = pEp.Message(1)
    1.13          msg.from_ = self.me
    1.14          msg.to = [self.you]
    1.15          msg.shortmsg = "Subject line"
    1.16 @@ -64,6 +64,14 @@
    1.17          inc, keys, rating, consumed, flags = enc.decrypt()
    1.18          assert rating == 6
    1.19  
    1.20 +        msg = pEp.Message(1)
    1.21 +        msg.from_ = self.me
    1.22 +        msg.to = [self.you]
    1.23 +        msg.shortmsg = "Subject line complete"
    1.24 +        msg.longmsg = "Message Text complete\n"
    1.25 +
    1.26 +        enc = msg.encrypt()
    1.27 +        send_message("test2", str(enc))
    1.28  
    1.29  class Test2:
    1.30  
    1.31 @@ -97,7 +105,7 @@
    1.32          pEp.update_identity(i)
    1.33          return i
    1.34  
    1.35 -    def test_recv_and_send_message(self):
    1.36 +    def test_handshake(self):
    1.37          setup_gnupg() ; import pEp
    1.38  
    1.39          txt = wait_for_message()
    1.40 @@ -114,3 +122,8 @@
    1.41          enc = out.encrypt()
    1.42          send_message("test1", str(enc))
    1.43  
    1.44 +        txt = wait_for_message()
    1.45 +        msg = pEp.Message(txt)
    1.46 +        msg.decrypt()
    1.47 +        assert msg.from_.address == self.you.address
    1.48 +