예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
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})
예제 #4
0
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,
        })
예제 #5
0
 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)