

def test_add_amazon_channel(self):
    airship = ua.Airship('key', 'secret')
    batch = ua.BatchTag(airship)
    with mock.patch.object(ua.Airship, '_request') as mock_request:
        response = requests.Response()
        response._content = json.dumps([{
            'amazon_channel': '9c36e8c7-5a73-47c0-9716-99fd3d4197d7',
            'tags': ['amazon_test_batch_tag', 'tag_6'],
        }])
        response.status_code = 202
        airship.return_value = response
        batch.add_amazon_channel('9c36e8c7-5a73-47c0-9716-99fd3d4197d7', ['amazon_test_batch_tag', 'tag_6'])
        self.assertEqual(batch.changelist, [{
            'amazon_channel': '9c36e8c7-5a73-47c0-9716-99fd3d4197d7',
            'tags': ['amazon_test_batch_tag', 'tag_6'],
        }])

dataset/ETHPy150Open urbanairship/python-library/tests/devices/test_tags.py TestBatchTag.test_add_amazon_channel/VarMisuse@91/159 `mock_request`->`airship`