Skip to content

Commit 70c9651

Browse files
Update tests to refer postman mock server and fix failing tests
1 parent a452adf commit 70c9651

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

tests/accounting/api/cassettes/test_invoice_attachment_upload_and_download.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,7 +3191,7 @@ interactions:
31913191
\"OK\",\r\n \"ProviderName\": \"python-sdk\",\r\n \"DateTimeUTC\": \"\\/Date(1588633398797)\\/\",\r\n
31923192
\ \"Attachments\": [\r\n {\r\n \"AttachmentID\": \"40fa0d97-8b94-4948-b299-4bcbe73dafc3\",\r\n
31933193
\ \"FileName\": \"inv-0032.pdf\",\r\n \"Url\": \"https://api.xero.com/api.xro/2.0/Invoices/22b3fab4-ef56-4d70-a110-a7cc3c1a26cd/Attachments/inv-0032.pdf\",\r\n
3194-
\ \"MimeType\": \"application/pdf\",\r\n \"ContentLength\": 54574\r\n
3194+
\ \"MimeType\": \"application/pdf\",\r\n \"ContentLength\": 54574,\r\n \"IncludeOnline\": true
31953195
\ }\r\n ]\r\n}"
31963196
headers:
31973197
Cache-Control:
@@ -3244,7 +3244,7 @@ interactions:
32443244
\"OK\",\r\n \"ProviderName\": \"python-sdk\",\r\n \"DateTimeUTC\": \"\\/Date(1588633399616)\\/\",\r\n
32453245
\ \"Attachments\": [\r\n {\r\n \"AttachmentID\": \"40fa0d97-8b94-4948-b299-4bcbe73dafc3\",\r\n
32463246
\ \"FileName\": \"inv-0032.pdf\",\r\n \"Url\": \"https://api.xero.com/api.xro/2.0/Invoices/22b3fab4-ef56-4d70-a110-a7cc3c1a26cd/Attachments/inv-0032.pdf\",\r\n
3247-
\ \"MimeType\": \"application/pdf\",\r\n \"ContentLength\": 54574\r\n
3247+
\ \"MimeType\": \"application/pdf\",\r\n \"ContentLength\": 54574,\r\n \"IncludeOnline\": true
32483248
\ }\r\n ]\r\n}"
32493249
headers:
32503250
Cache-Control:

tests/accounting/api/test_accounting_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def accounting_api(api_client):
4343
def sandbox_accounting_api(api_client):
4444
return AccountingApi(
4545
api_client=api_client,
46-
base_url="https://xero-accounting.getsandbox.com/api.xro/2.0",
46+
base_url="https://25faf04a-c71e-40e7-b7ce-f1fae0149465.mock.pstmn.io/api.xro/2.0",
4747
)
4848

4949

@@ -373,6 +373,7 @@ def test_get_invoices(sandbox_accounting_api: AccountingApi, xero_tenant_id):
373373
is_discounted=False,
374374
line_amount_types=LineAmountTypes.EXCLUSIVE,
375375
reference="Red Fish, Blue Fish",
376+
repeating_invoice_id= '428c0d75-909f-4b04-8403-a48dc27283b0',
376377
sent_to_contact=True,
377378
status="VOIDED",
378379
sub_total=Decimal("40.00"),

tests/identity/api/cassettes/test_get_connections.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interactions:
1111
User-Agent:
1212
- xero-python (0.1.0)
1313
method: GET
14-
uri: https://api.xero.com/connections
14+
uri: https://api.xero.com/Connections
1515
response:
1616
body:
1717
string: '[{"id":"f4a87932-0878-4884-abcf-73191dd810ba","tenantId":"a46fcb6f-2773-40c4-a119-8aa08bca1e8e","tenantType":"ORGANISATION","createdDateUtc":"2020-03-18T21:20:07.7179250","updatedDateUtc":"2020-03-30T05:15:13.3513620"}]'

tests/test_api_client/test_deserializer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_deserialize_bool(data, expected):
161161
assert result == expected
162162

163163

164-
@pytest.mark.parametrize("data", [None, "", "1", "0", 1, 0])
164+
@pytest.mark.parametrize("data", ["", "1", "0", 1, 0])
165165
def test_deserialize_bool_error(data):
166166
# given data type bool
167167
data_type = "bool"
@@ -189,7 +189,7 @@ def test_deserialize_date(data, expected):
189189
assert result == expected
190190

191191

192-
@pytest.mark.parametrize("data", [None, "", "2019-oo-01"])
192+
@pytest.mark.parametrize("data", ["", "2019-oo-01"])
193193
def test_deserialize_date_error(data):
194194
# given data type date
195195
data_type = "date"
@@ -268,7 +268,7 @@ def test_deserialize_datetime(data, expected):
268268
assert result == expected
269269

270270

271-
@pytest.mark.parametrize("data", [None, "", "invalid"])
271+
@pytest.mark.parametrize("data", ["", "invalid"])
272272
def test_deserialize_datetime_error(data):
273273
# given data type datetime
274274
data_type = "datetime"
@@ -349,7 +349,7 @@ def __init__(self, **kwargs):
349349
deserialize.assert_any_call("str", "short description", None)
350350

351351

352-
@pytest.mark.parametrize("data", [None, "", 1, True])
352+
@pytest.mark.parametrize("data", ["", 1, True])
353353
def test_deserialize_model_error(data):
354354
# given test model and invalid test data
355355
class Model:

0 commit comments

Comments
 (0)