forked from openmsa/python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_customer_delete.py
More file actions
46 lines (36 loc) · 1.28 KB
/
test_customer_delete.py
File metadata and controls
46 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
Test Customer Delete
"""
from unittest.mock import patch
from msa_sdk.customer import Customer
from util import customer_fixture # pylint: disable=unused-import
def test_delete_customer_by_id(customer_fixture):
"""
Test delete customer by ID
"""
customer = customer_fixture
local_path = '/customer/id/6'
with patch('requests.delete') as mock_call_delete:
customer.delete_customer_by_id(6)
assert customer.path == local_path
mock_call_delete.assert_called_once()
def test_delete_customer_by_reference(customer_fixture):
"""
Test delete customer by reference
"""
customer = customer_fixture
local_path = '/customer/reference/AAAA6'
with patch('requests.delete') as mock_call_delete:
customer.delete_customer_by_reference('AAAA6')
assert customer.path == local_path
mock_call_delete.assert_called_once()
def test_delete_variable_by_name(customer_fixture):
"""
Test delete variable by name
"""
customer = customer_fixture
local_path = '/customer/id/6/variables/variableName'
with patch('requests.delete') as mock_call_delete:
customer.delete_variable_by_name(6, 'variableName')
assert customer.path == local_path
mock_call_delete.assert_called_once()