Example #1
0
    def test_learn_hosted_services(self):
        """Make sure requests to learners actually result in learned services.

        """
        controller.query(self.conn, "learn", self.santiago.me, self.service, action="POST")

        self.assertEqual(self.santiago.get_client_locations(self.santiago.me, self.service), self.value)
Example #2
0
    def test_learn_hosted_services_the_right_way(self):
        """Make sure requests to listeners actually result in learned services.

        """
        controller.query(self.conn, "/", action="POST", body=self.request)

        time.sleep(1)

        self.assertEqual(self.santiago.get_client_locations(self.santiago.me, self.service), self.value)
Example #3
0
    def test_learn_hosted_services(self):
        """Make sure requests to listeners actually result in learned services.

        FIXME: or rather, fix controller::Listener::index.  I shouldn't be able
        to GET here.

        """
        controller.query(self.conn, "/", params=self.request)

        time.sleep(1)

        self.assertEqual(self.santiago.get_client_locations(self.santiago.me, self.service), self.value)
Example #4
0
    def test_redirected_to_service(self):
        """The HTTPS controller redirects to the learned service's location."""

        data = controller.query(self.conn, "learn", self.santiago.me,
                                self.service, action="POST")

        self.assertIn("""\
This resource can be found at <a href='https://{0}:{1}/consuming/{2}/{3}'>\
""".format(self.conn.host, self.conn.port, self.santiago.me, self.service),
                      data)
Example #5
0
    def test_post(self):
        controller.query(self.conn, url="/stop")

        self.assertFalse(self.santiago.live)