From 1090d7476f08313202c82d4f6f3ea2ee81231a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Le=20Calvar?= Date: Sun, 20 May 2018 12:55:25 +0200 Subject: Fix optional args in account_update_credentials avatar and header are now correctly ignored if not specified. --- tests/test_account.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/test_account.py b/tests/test_account.py index 240abca..2716ad1 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -92,3 +92,23 @@ def test_account_update_credentials(api): header = image, header_mime_type = "image/jpeg") assert account + +@pytest.mark.vcr(match_on=['path']) +def test_account_update_credentials_no_header(api): + account = api.account_update_credentials( + display_name='John Lennon', + note='I walk funny', + avatar = "tests/image.jpg") + assert account + +@pytest.mark.vcr(match_on=['path']) +def test_account_update_credentials_no_avatar(api): + with open('tests/image.jpg', 'rb') as f: + image = f.read() + + account = api.account_update_credentials( + display_name='John Lennon', + note='I walk funny', + header = image, + header_mime_type = "image/jpeg") + assert account -- cgit v1.2.3