def test_channels(self): expected_resp = json.dumps({}) mb = MessageBusAPIClient(self.api_key) channel = "test_channel" path = "%s" % constants.end_points["channels"] mb.__dict__["_MessageBusBase__connection"] = self._setup_mock_connection("GET", path, "", 200, expected_resp) received_resp = json.dumps(mb.get_channels(), sort_keys=True) self._validate_results(expected_resp, received_resp) self.mocker.UnsetStubs() path = "%s" % constants.end_points["channels"] mb.__dict__["_MessageBusBase__connection"] = self._setup_mock_connection("GET", path, "", 200, expected_resp) received_resp = json.dumps(mb.get_channels(), sort_keys=True) self._validate_results(expected_resp, received_resp) self.mocker.UnsetStubs() path = "%s" % constants.end_points["channel_config"] % {"channel_key": channel} mb.__dict__["_MessageBusBase__connection"] = self._setup_mock_connection("GET", path, "", 200, expected_resp) received_resp = json.dumps(mb.get_channel_config("test_channel"), sort_keys=True) self._validate_results(expected_resp, received_resp) self.mocker.UnsetStubs()