def test_invalid_poa_node_b(self):
        self.cs_b.poa = ClosedSwarm.POA(self.torrent_id, "stuff", "stuff2")

        # Update to a bad POA
        msg_1 = self.cs_a.a_create_challenge()
        msg_2 = self.cs_b.b_create_challenge(msg_1)
        msg_3 = self.cs_a.a_provide_poa_message(msg_2)
        msg_4 = self.cs_b.b_provide_poa_message(msg_3)
        try:
            self.cs_a.a_check_poa_message(msg_4)
            self.fail("Node B failed to discover bad POA")
        except ClosedSwarm.InvalidPOAException, e:
            pass
    def test_invalid_poa_node_a(self):

        self.cs_a.poa = ClosedSwarm.POA("bad_poa_a", "stuff", "stuff2")

        # Update to a bad POA
        msg_1 = self.cs_a.a_create_challenge()
        msg_2 = self.cs_b.b_create_challenge(msg_1)
        msg_3 = self.cs_a.a_provide_poa_message(msg_2)
        msg_4 = self.cs_b.b_provide_poa_message(msg_3)
        self.cs_a.a_check_poa_message(msg_4)

        self.assertTrue(self.cs_a.is_remote_node_authorized())
        self.assertFalse(self.cs_b.is_remote_node_authorized())