

def test_add_android_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([{
            'android_channel': '9c36e8c7-5a73-47c0-9716-99fd3d4197d6',
            'tags': ['android_test_batch_tag', 'tag4'],
        }]).encode('utf-8')
        response.status_code = 202
        mock_request.return_value = response
        batch.add_android_channel('9c36e8c7-5a73-47c0-9716-99fd3d4197d6', ['android_test_batch_tag', 'tag4'])
        self.assertEqual(mock_request.changelist, [{
            'android_channel': '9c36e8c7-5a73-47c0-9716-99fd3d4197d6',
            'tags': ['android_test_batch_tag', 'tag4'],
        }])

dataset/ETHPy150Open urbanairship/python-library/tests/devices/test_tags.py TestBatchTag.test_add_android_channel/VarMisuse@119/233 `batch`->`mock_request`