def setUp(self): self.pubnub = MagicMock(spec=PubNub, config=pnconf, sdk_name=sdk_name, uuid=None) self.pubnub.uuid = "UUID_ListChannelsInCGTest" self.list = RemoveChannelGroup(self.pubnub)
def setUp(self): self.pubnub = MagicMock(spec=PubNub, config=pnconf, sdk_name=sdk_name, uuid=None, _get_token=lambda: None) self.pubnub.uuid = "UUID_ListChannelsInCGTest" self.pubnub._telemetry_manager = TelemetryManager() self.list = RemoveChannelGroup(self.pubnub)
class TestRemoveChannelGroup(unittest.TestCase): def setUp(self): self.pubnub = MagicMock(spec=PubNub, config=pnconf, sdk_name=sdk_name, uuid=None) self.pubnub.uuid = "UUID_ListChannelsInCGTest" self.list = RemoveChannelGroup(self.pubnub) def test_list_channel_group(self): self.list.channel_group("gr") self.assertEquals(self.list.build_path(), RemoveChannelGroup.REMOVE_PATH % (pnconf.subscribe_key, "gr")) self.assertEqual(self.list.build_params_callback()({}), {"pnsdk": sdk_name, "uuid": self.pubnub.uuid})
class TestRemoveChannelGroup(unittest.TestCase): def setUp(self): self.pubnub = MagicMock(spec=PubNub, config=pnconf, sdk_name=sdk_name, uuid=None) self.pubnub.uuid = "UUID_ListChannelsInCGTest" self.list = RemoveChannelGroup(self.pubnub) def test_list_channel_group(self): self.list.channel_group('gr') self.assertEquals( self.list.build_path(), RemoveChannelGroup.REMOVE_PATH % (pnconf.subscribe_key, "gr")) self.assertEqual(self.list.build_params_callback()({}), { 'pnsdk': sdk_name, 'uuid': self.pubnub.uuid, })