示例#1
0
 def test_auth_end_in_incorrect_state(self):
     conn = Connection(our_role="server")
     conn._conn.machine.set_state("greeting_request")
     with self.assertRaises(ProtocolError):
         conn.auth_end()
示例#2
0
 def test_auth_end_in_incorrect_state(self):
     conn = Connection(our_role="server")
     conn._conn.machine.set_state("greeting_request")
     with self.assertRaises(ProtocolError):
         conn.auth_end()
示例#3
0
    def test_auth_end(self):
        conn = Connection(our_role="server")
        conn._conn.machine.set_state("auth_inprogress")

        conn.auth_end()
        self.assertEqual(conn._conn.state, "request")
示例#4
0
    def test_auth_end(self):
        conn = Connection(our_role="client")
        conn._conn.machine.set_state("auth_inprogress")

        conn.auth_end()
        self.assertEqual(conn._conn.state, "request")