def test_authenticate(self, client: MDMClient, authenticate_request: str): """Basic test: Authenticate""" response: Response = client.put('/checkin', data=authenticate_request, content_type='text/xml') assert response.status_code != 410 assert response.status_code == 200
def test_tokenupdate(self, client: MDMClient, tokenupdate_request: str): """Test a client attempting to update its token after being unenrolled is forced to unenroll via code 410.""" response: Response = client.put('/checkin', data=tokenupdate_request, content_type='text/xml') assert response.status_code != 200 assert response.status_code == 410
def test_checkout(self, client: MDMClient, checkout_request: str): """Test a CheckOut message""" response: Response = client.put('/checkin', data=checkout_request, content_type='text/xml') assert response.status_code != 410 assert response.status_code == 200
def test_device_information_response(self, client: MDMClient, device_information_response: str): response: Response = client.put('/mdm', data=device_information_response, content_type='text/xml') assert response.status_code != 410 assert response.status_code == 200
def test_profile_list_response(self, client: MDMClient, profile_list_response: str): response: Response = client.put('/mdm', data=profile_list_response, content_type='text/xml') assert response.status_code != 410 assert response.status_code == 200
def test_certificate_list_response(self, client: MDMClient, certificate_list_response: str, session): response: Response = client.put('/mdm', data=certificate_list_response, content_type='text/xml') assert response.status_code != 410 assert response.status_code == 200 d = session.query(Device).filter(Device.udid == '00000000-1111-2222-3333-444455556666').one() ic = d.installed_certificates assert len(ic) == 2
def test_available_os_updates_response(self, client: MDMClient, available_os_updates_request: str, session): response: Response = client.put('/mdm', data=available_os_updates_request, content_type='text/xml') assert response.status_code != 410 assert response.status_code == 200 d: Device = session.query(Device).filter(Device.udid == '00000000-1111-2222-3333-444455556666').one() updates = d.available_os_updates plist = plistlib.loads(available_os_updates_request.encode('utf8')) assert len(updates) == len(plist['AvailableOSUpdates'])
def test_user_tokenupdate(self, client: MDMClient, tokenupdate_user_request: str): """Test a TokenUpdate message on the user channel.""" response: Response = client.put('/checkin', data=tokenupdate_user_request, content_type='text/xml') assert response.status_code != 410 assert response.status_code == 200