Exemplo n.º 1
0
    def test_get_exam_by_id(self):
        """Test case for get_exam_by_id

        Get exam by id
        """
        body = User()
        response = self.client.open('/exam/{examId}'.format(examId=789),
                                    method='POST',
                                    data=json.dumps(body),
                                    content_type='application/json')
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
Exemplo n.º 2
0
    def test_get_exam(self):
        """Test case for get_exam

        Get all exams
        """
        body = User(os.environ['USERNAME'], os.environ['PASS'])
        response = self.client.open('/exam',
                                    method='POST',
                                    data=json.dumps(body),
                                    content_type='application/json')
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
Exemplo n.º 3
0
    def test_get_enrolled_exam(self):
        """Test case for get_enrolled_exam

        Get enrolled exams
        """
        body = User()
        response = self.client.open('/exam/enrolled',
                                    method='POST',
                                    data=json.dumps(body),
                                    content_type='application/json')
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
Exemplo n.º 4
0
    def test_get_schedule_agenda(self):
        """Test case for get_schedule_agenda

        Get week schedule agenda
        """
        body = User(os.environ['INSIS_USERNAME'], os.environ['INSIS_PASS'])
        response = self.client.open(
            '/agenda',
            method='POST',
            data=json.dumps(body),
            content_type='application/json')
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
Exemplo n.º 5
0
    def test_get_grades_from_subject(self):
        """Test case for get_grades_from_subject

        Get grades from subject
        """
        body = User()
        response = self.client.open(
            '/grades/{subjectId}'.format(subjectId=789),
            method='POST',
            data=json.dumps(body),
            content_type='application/json')
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
Exemplo n.º 6
0
def get_enrolled_subjects(body):  # noqa: E501
    """Get enrolled subjects

     # noqa: E501

    :param body: Insis user credentials
    :type body: dict | bytes

    :rtype: Exam
    """
    if connexion.request.is_json:
        body = User.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'
Exemplo n.º 7
0
def get_grades_from_subject(subjectId, body):  # noqa: E501
    """Get grades from subject

     # noqa: E501

    :param subjectId: ID of subject which grades needs to be fetched
    :type subjectId: int
    :param body: Insis user credentials
    :type body: dict | bytes

    :rtype: Exam
    """
    if connexion.request.is_json:
        body = User.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'
Exemplo n.º 8
0
def get_credentials() -> Optional['User']:
    if connexion.request.is_json:
        return User.from_dict(connexion.request.get_json())  # noqa: E501