Skip to content

Commit feb6a48

Browse files
committed
add property decrator to organization_id
1 parent ce9b250 commit feb6a48

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

identify/resources/identity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def environment_id(self):
107107
def values(self):
108108
return self._values
109109

110+
@property
110111
def organization_id(self):
111112
return self._organization_id
112113

identify/tests/resources/test_identity.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,34 @@ def test_constructor(self, mocker):
2424
from identify.resources.base_resource import BaseResource
2525
BaseResource.__init__.assert_called_once_with(env, client, 'key')
2626

27-
def from_dict(self):
27+
def test_from_dict(self, mocker):
2828
'''
2929
'''
30-
# TODO!
31-
assert False
30+
client = object()
31+
mock_init = mocker.Mock()
32+
mocker.patch(
33+
'identify.resources.identity.Identity.__init__',
34+
new=mock_init
35+
)
36+
Identity.__init__.return_value = None
37+
Identity.from_dict(
38+
client,
39+
{
40+
'key': 'key',
41+
'trafficTypeId': '123',
42+
'environmentId': '456',
43+
'values': {'asd': 1},
44+
'organizationId': 'oo1',
45+
}
46+
)
47+
Identity.__init__.assert_called_once_with(
48+
client,
49+
'key',
50+
'123',
51+
'456',
52+
{'asd': 1},
53+
'oo1',
54+
)
3255

3356
def test_create(self, mocker):
3457
'''

0 commit comments

Comments
 (0)