def test_save_channels(self): chid = str(uuid.uuid4()) chid2 = str(uuid.uuid4()) m = get_rotating_message_table() message = Message(m, SinkMetrics()) message.register_channel(self.uaid, chid) message.register_channel(self.uaid, chid2) exists, chans = message.all_channels(self.uaid) new_uaid = uuid.uuid4().hex message.save_channels(new_uaid, chans) _, new_chans = message.all_channels(new_uaid) eq_(chans, new_chans)
def test_save_channels(self): chid = str(uuid.uuid4()) chid2 = str(uuid.uuid4()) m = get_rotating_message_tablename(boto_resource=self.resource) message = Message(m, boto_resource=self.resource) message.register_channel(self.uaid, chid) message.register_channel(self.uaid, chid2) exists, chans = message.all_channels(self.uaid) new_uaid = uuid.uuid4().hex message.save_channels(new_uaid, chans) _, new_chans = message.all_channels(new_uaid) assert chans == new_chans
def test_all_channels(self): chid = str(uuid.uuid4()) chid2 = str(uuid.uuid4()) m = get_rotating_message_table() message = Message(m, SinkMetrics()) message.register_channel(self.uaid, chid) message.register_channel(self.uaid, chid2) _, chans = message.all_channels(self.uaid) assert chid in chans assert chid2 in chans message.unregister_channel(self.uaid, chid2) _, chans = message.all_channels(self.uaid) assert chid2 not in chans assert chid in chans
def test_all_channels(self): chid = str(uuid.uuid4()) chid2 = str(uuid.uuid4()) m = get_rotating_message_tablename(boto_resource=self.resource) message = Message(m, boto_resource=self.resource) message.register_channel(self.uaid, chid) message.register_channel(self.uaid, chid2) _, chans = message.all_channels(self.uaid) assert chid in chans assert chid2 in chans message.unregister_channel(self.uaid, chid2) _, chans = message.all_channels(self.uaid) assert chid2 not in chans assert chid in chans
def test_all_channels(self): chid = str(uuid.uuid4()) chid2 = str(uuid.uuid4()) m = get_rotating_message_table() message = Message(m, SinkMetrics()) message.register_channel(self.uaid, chid) message.register_channel(self.uaid, chid2) _, chans = message.all_channels(self.uaid) assert (chid in chans) assert (chid2 in chans) message.unregister_channel(self.uaid, chid2) _, chans = message.all_channels(self.uaid) assert (chid2 not in chans) assert (chid in chans)
def test_all_channels_fail(self): m = get_rotating_message_table() message = Message(m, SinkMetrics()) message.table.get_item = Mock() message.table.get_item.return_value = { "ResponseMetadata": { "HTTPStatusCode": 400 }, } res = message.all_channels(self.uaid) assert res == (False, set([]))
def test_all_channels_fail(self): m = get_rotating_message_tablename(boto_resource=self.resource) message = Message(m, boto_resource=self.resource) mtable = Mock() mtable.get_item.return_value = { "ResponseMetadata": { "HTTPStatusCode": 400 }, } message.table = mtable res = message.all_channels(self.uaid) assert res == (False, set([]))
def test_all_channels_no_uaid(self): m = get_rotating_message_table() message = Message(m, SinkMetrics()) exists, chans = message.all_channels("asdf") assert chans == set([])
def test_all_channels_no_uaid(self): m = get_rotating_message_tablename(boto_resource=self.resource) message = Message(m, boto_resource=self.resource) exists, chans = message.all_channels(dummy_uaid) assert chans == set([])
def test_all_channels_no_uaid(self): m = get_rotating_message_table() message = Message(m, SinkMetrics()) exists, chans = message.all_channels(dummy_uaid) assert (chans == set([]))
def test_all_channels_no_uaid(self): m = get_message_table() message = Message(m, SinkMetrics()) assert(message.all_channels("asdf") == set([]))
def test_all_channels_no_uaid(self): m = get_message_table() message = Message(m, SinkMetrics()) assert (message.all_channels("asdf") == set([]))