Skip to content

Commit 75e4736

Browse files
committed
Fix for tests and updated readme
1 parent 9634550 commit 75e4736

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build Status](https://travis-ci.org/UpCloudLtd/upcloud-python-api.svg?branch=master)](https://travis-ci.org/UpCloudLtd/upcloud-python-api) [![Code Health](https://landscape.io/github/UpCloudLtd/upcloud-python-api/master/landscape.svg?style=flat)](https://landscape.io/github/UpCloudLtd/upcloud-python-api/master) [![PyPI version](https://badge.fury.io/py/upcloud-api.svg)](https://badge.fury.io/py/upcloud-api) [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/UpCloudLtd/upcloud-python-api/blob/master/LICENSE)
22

33
# UpCloud's Python API Client
4-
OOP-based api client for [UpCloud's API](https://www.upcloud.com/documentation/api/). Features most of the API's functionality and some convenience functions that combine several API endpoints and logic.
4+
OOP-based api client for [UpCloud's API](https://developers.upcloud.com/1.3/). Features most of the API's functionality and some convenience functions that combine several API endpoints and logic.
55

66
NOTE: This Python client is still evolving. Please test all of your use cases thoroughly before actual production use. Using a separate UpCloud account for testing / developing the client is recommended.
77

@@ -29,15 +29,18 @@ python setup.py install
2929
(http://stackoverflow.com/questions/29099404/ssl-insecureplatform-error-when-using-requests-package)
3030

3131

32-
**Supported versions as of 0.3.3** (offline tests pass with tox):
32+
**Supported versions as of 0.4.6** (offline tests pass with tox):
3333

3434
* <del>python 2.6</del> removed due to deprecation
35-
* python 2.7
35+
* python 2.7 supported but not recommended, especially when upcloud-ansible will be ported to python3
3636
* <del>python 3.2</del> removed due to python2/3 support
37-
* <del>python 3.3</del> removed due to deprecation
38-
* python 3.4
39-
* python 3.5
40-
* pypi3 2.4.0
37+
* <del>python 3.3</del> removed due to python2/3 support
38+
* <del>python 3.4</del> removed due to python2/3 support
39+
* <del>python 3.5</del> removed due to python2/3 support
40+
* python 3.6
41+
* python 3.7
42+
* python 3.9
43+
* pypi3
4144

4245
## Features
4346
* OOP based management of Servers, Storages and IP-addresses with full CRUD.

test/conftest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ def read_from_file(filename):
3939
return read_from_file(filename)
4040

4141
@staticmethod
42-
def mock_get(target, response_file=None, match_querystring=False):
42+
def mock_get(target, response_file=None):
4343
if not response_file:
4444
response_file = target + '.json'
4545

4646
data = Mock.read_from_file(response_file)
4747
responses.add(responses.GET, Mock.base_url + '/' + target,
4848
body=data,
4949
status=200,
50-
content_type='application/json',
51-
match_querystring=match_querystring)
50+
content_type='application/json')
5251
return data
5352

5453
@staticmethod

test/json_data/object-storage_06b0e4fc-d74b-455e-a373-60cd6ca84022_stats_network_?from=2020-11-03T00%3A00%3A00%2B02%3A00.json renamed to test/json_data/object-storage_06b0e4fc-d74b-455e-a373-60cd6ca84022_stats_network.json

File renamed without changes.

test/test_object_storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def test_delete_object_storage(self, manager):
5858

5959
@responses.activate
6060
def test_get_object_storage_network_statistics(self, manager):
61-
data = Mock.mock_get('object-storage/06b0e4fc-d74b-455e-a373-60cd6ca84022/stats/network/?from=2020-11-03T00%3A00%3A00%2B02%3A00', match_querystring=True)
61+
data = Mock.mock_get('object-storage/06b0e4fc-d74b-455e-a373-60cd6ca84022/stats/network/', response_file='object-storage_06b0e4fc-d74b-455e-a373-60cd6ca84022_stats_network.json')
6262
res = manager.get_object_storage_network_statistics('06b0e4fc-d74b-455e-a373-60cd6ca84022', '2020-11-03 00:00:00')
6363

6464
assert 'stats' in res
65-
assert len(res.get('stats').get('stat')) == 3
65+
assert len(res.get('stats').get('stat')) == 3

0 commit comments

Comments
 (0)