File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 '''
You can’t perform that action at this time.
0 commit comments