def test_interview_comment(session, params): with raises(TypeError): InterviewsApi(session).comment(params['InterviewId'], comment="aaa") # no way to check comments for now, make sure there are no exceptions InterviewsApi(session).comment(params['InterviewId'], comment="aaa", variable="Q01")
def test_interview_assign(session, params): with raises(NotAcceptableError): InterviewsApi(session).assign(params['InterviewId'], '00000000-0000-0000-0000-000000000000')
def test_interview_hqunapprove(session, params): with raises(NotAcceptableError): assert InterviewsApi(session).hqunapprove(params['InterviewId'])
def test_interview_reject(session, params): with raises(NotAcceptableError): assert InterviewsApi(session).reject(params['InterviewId'])
def test_interview_history(session, params): """Tests an API call to get an interview history""" r = InterviewsApi(session).history(params['InterviewId']) assert 'InterviewId' in r.keys( ), "The Questions key should be in the response"
def test_interview_details(session, params): """Tests an API call to get an interview details""" r = InterviewsApi(session).get_info(params['InterviewId']) assert r.get_answer("Q01") == "Yes"
def test_interview_list(session, params): r = InterviewsApi(session).get_list( questionnaire_id=to_hex(params['TemplateId'])) assert isinstance(r, types.GeneratorType) assert isinstance(next(r), Interview), "There should be a list of Interview objects"