1+ import datetime
12import os
23import unittest
34
45from ..client import ConciergeClient
5- import datetime
6+ from .. utils import get_session_id
67
78
8- MS_USER_ID = os .environ .get ("MS_USER_ID" , None )
9- MS_USER_PASS = os .environ .get ("MS_USER_PASS" , None )
109MS_ACCESS_KEY = os .environ ["MS_ACCESS_KEY" ]
1110MS_SECRET_KEY = os .environ ["MS_SECRET_KEY" ]
1211MS_ASSOCIATION_ID = os .environ ["MS_ASSOCIATION_ID" ]
@@ -55,9 +54,8 @@ def test_request_session(self):
5554 # Check that the session ID in the response headers matches the
5655 # previously obtained session, so the user was not re-authenticated
5756 # but properly used the established session.
58- self .assertEqual (
59- client .get_session_id_from_login_result (login_result = response ),
60- client .session_id )
57+ self .assertEqual (get_session_id (result = response ),
58+ client .session_id )
6159
6260 def test_query_orgs (self ):
6361 """
@@ -84,29 +82,6 @@ def test_query_orgs(self):
8482 response = client .query_orgs (parameters , since_when )
8583 # self.assertFalse(response)
8684
87- def test_convert_ms_object (self ):
88- """
89- Can we parse the list of dicts for org attributes into a dict?
90- """
91- client = ConciergeClient (access_key = MS_ACCESS_KEY ,
92- secret_key = MS_SECRET_KEY ,
93- association_id = MS_ASSOCIATION_ID )
94-
95- # Send a login request to receive a session id
96- session_id = client .request_session ()
97- self .assertTrue (session_id )
98- parameters = {
99- 'Name' : 'AASHE Test Campus' ,
100- }
101- response = client .query_orgs (parameters )
102- self .assertEqual (response [0 ]["Fields" ]["KeyValueOfstringanyType" ]
103- [28 ]["Value" ],
104- 'AASHE Test Campus' )
105- converted_dict = client .convert_ms_object (
106- response [0 ]["Fields" ]["KeyValueOfstringanyType" ])
107-
108- self .assertEqual (converted_dict ["Name" ], "AASHE Test Campus" )
109-
11085
11186if __name__ == '__main__' :
11287 unittest .main ()
0 commit comments