mirror of
				https://github.com/Eledio/superfaktura-client.git
				synced 2025-10-31 16:11:20 +01:00 
			
		
		
		
	test_client_contact: add api credinitials
This commit is contained in:
		| @@ -1,3 +1,5 @@ | |||||||
|  | import os | ||||||
|  |  | ||||||
| import pytest  # type: ignore | import pytest  # type: ignore | ||||||
| from unittest.mock import patch | from unittest.mock import patch | ||||||
| from superfaktura.client_contacts import ( | from superfaktura.client_contacts import ( | ||||||
| @@ -9,8 +11,17 @@ from superfaktura.client_contacts import ( | |||||||
|  |  | ||||||
| @pytest.fixture | @pytest.fixture | ||||||
| def client_contact(): | def client_contact(): | ||||||
|     with patch("superfaktura.client_contacts.ClientContact", return_value=None): |     with patch.dict( | ||||||
|         return ClientContact() |         os.environ, | ||||||
|  |         { | ||||||
|  |             "SUPERFAKTURA_API_KEY": "test_key", | ||||||
|  |             "SUPERFAKTURA_API_URL": "https://api.superfaktura.cz", | ||||||
|  |             "SUPERFAKTURA_API_EMAIL": "test_email", | ||||||
|  |             "SUPERFAKTURA_API_COMPANY_ID": "test_company_id", | ||||||
|  |         }, | ||||||
|  |     ): | ||||||
|  |         with patch("superfaktura.client_contacts.ClientContact", return_value=None): | ||||||
|  |             return ClientContact() | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_add_contact_success(client_contact): | def test_add_contact_success(client_contact): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user