@@ -153,4 +153,53 @@ def test_delete_organization_connection(self, mock_rc):
153153
154154 mock_instance .delete .assert_called_with (
155155 'https://domain/api/v2/organizations/test-org/enabled_connections/test-con'
156+ )
157+
158+ # Organization Connections
159+ @mock .patch ('auth0.v3.management.organizations.RestClient' )
160+ def test_all_organization_members (self , mock_rc ):
161+ mock_instance = mock_rc .return_value
162+
163+ c = Organizations (domain = 'domain' , token = 'jwttoken' )
164+
165+ # Default parameters are requested
166+ c .all_organization_members ('test-org' )
167+
168+ args , kwargs = mock_instance .get .call_args
169+
170+ self .assertEqual ('https://domain/api/v2/organizations/test-org/members' , args [0 ])
171+ self .assertEqual (kwargs ['params' ], {'page' : None ,
172+ 'per_page' : None })
173+
174+ # Specific pagination
175+ c .all_organization_members ('test-org' , page = 7 , per_page = 25 )
176+
177+ args , kwargs = mock_instance .get .call_args
178+
179+ self .assertEqual ('https://domain/api/v2/organizations/test-org/members' , args [0 ])
180+ self .assertEqual (kwargs ['params' ], {'page' : 7 ,
181+ 'per_page' : 25 })
182+
183+ @mock .patch ('auth0.v3.management.organizations.RestClient' )
184+ def test_create_organization_members (self , mock_rc ):
185+ mock_instance = mock_rc .return_value
186+
187+ c = Organizations (domain = 'domain' , token = 'jwttoken' )
188+ c .create_organization_members ('test-org' , {'a' : 'b' , 'c' : 'd' })
189+
190+ mock_instance .post .assert_called_with (
191+ 'https://domain/api/v2/organizations/test-org/members' ,
192+ data = {'a' : 'b' , 'c' : 'd' }
193+ )
194+
195+ @mock .patch ('auth0.v3.management.organizations.RestClient' )
196+ def test_delete_organization_members (self , mock_rc ):
197+ mock_instance = mock_rc .return_value
198+
199+ c = Organizations (domain = 'domain' , token = 'jwttoken' )
200+ c .delete_organization_members ('test-org' , {'a' : 'b' , 'c' : 'd' })
201+
202+ mock_instance .delete .assert_called_with (
203+ 'https://domain/api/v2/organizations/test-org/members' ,
204+ data = {'a' : 'b' , 'c' : 'd' }
156205 )
0 commit comments