def test_get_config(self):
        request = self.get()
        config_ = Config()
        response = config_.render(request)
        self.assertEqual(response, NOT_DONE_YET)
        self.assertTrue(request.finished)
        self.assertEqual(request.responseCode, OK)
        self.assertEqual(len(request.written), 1)
        response = loads(request.written[0])
        response.pop("last_master_contact")
        current_config = config.copy()
        current_config.pop("last_master_contact")
        response.pop("agent")

        for key in response:
            self.assertIn(key, current_config)

            # HTTP responses are not automatically
            # converted from plain text into UUID
            # objects.
            if key == "agent_id":
                response[key] = UUID(response[key])

            self.assertEqual(
                response[key], current_config[key],
                "Data for key %r %r != %r" % (
                    key, response[key], current_config[key]))

        self.assertDateAlmostEqual(
            config.master_contacted(update=False), datetime.utcnow())
 def setUp(self):
     super(TestStatus, self).setUp()
     self._config = config.copy()