more tests

This commit is contained in:
Kenneth Kehl
2023-08-11 11:47:57 -07:00
parent 318bb01392
commit 85604e5394
10 changed files with 189 additions and 30 deletions

View File

@@ -58,3 +58,14 @@ def test_should_raise_for_status(perf_client):
with pytest.raises(requests.HTTPError), requests_mock.Mocker() as request_mock:
request_mock.post('https://performance-platform-url/foo', json={}, status_code=403)
perf_client.send_stats_to_performance_platform({'dataType': 'foo'})
def generate_payload_id(payload, param):
pass
def test_generate_payload_id():
payload = {'_timestamp': '2023-01-01 00:00:00', 'service': 'my_service', 'group_name': 'group_name',
'dataType': 'dataType', 'period': 'period'}
result = PerformancePlatformClient.generate_payload_id(payload, "group_name")
assert result == 'MjAyMy0wMS0wMSAwMDowMDowMG15X3NlcnZpY2Vncm91cF9uYW1lZGF0YVR5cGVwZXJpb2Q='