

def test_list_tag(self):
    airship = ua.Airship('key', 'secret')
    test_list = ua.TagList(airship)
    with mock.patch.object(ua.Airship, '_request') as mock_request:
        response = requests.Response()
        response._content = json.dumps({
            'tags': ['tag1', 'some_tag', 'portland_or'],
        }).encode('utf-8')
        response.status_code = 200
        mock_request.return_value = response
        results = test_list.list_tags()
        self.assertEqual(results, {
            'tags': ['tag1', 'some_tag', 'portland_or'],
        })

dataset/ETHPy150Open urbanairship/python-library/tests/devices/test_tags.py TestTagList.test_list_tag/original