def test_prerequisites_queries_followup():
    query_module = QueryModule()

    test_message = 'I want to see the requirements for a course'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'prerequisites_queries_with_followup'
    assert result.message == 'Sure! Please tell me the course code of the course you want to find out prerequisites for.'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "COMP9331's requirements thanks"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'prerequisites_queries_with_followup-user_input_course_code' or 'prerequisites_queries'
    assert result.message == 'COMP9331'

    time.sleep(TIME_BETWEEN_API)
def test_course_outline_queries_followup_1():
    query_module = QueryModule()

    test_message = 'I want to find out more about a course'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'course_outline_queries_with_followup'
    assert result.message == 'Of course! What is the course code of the course you want to know the outline for?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "COMP9444's outline please"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'course_outline_queries_with_followup-user_input_course_code' or 'course_outline_queries'
    assert result.message == 'COMP9444'

    time.sleep(TIME_BETWEEN_API)
def test_study_level_queries_followup_2():
    query_module = QueryModule()

    test_message = 'I want to know if a course is for undergrad'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'study_level_queries_with_followup'
    assert result.message == 'Sure! What is the course code of the course you would like to find study level for?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "COMP9323 please"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'study_level_queries_with_followup-user_input_course_code' or 'study_level_queries'
    assert result.message == 'COMP9323'

    time.sleep(TIME_BETWEEN_API)
def test_course_outline_queries_followup_2():
    query_module = QueryModule()

    test_message = 'Show me the course description for a course'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'course_outline_queries_with_followup'
    assert result.message == 'Of course! What is the course code of the course you want to know the outline for?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = 'Show me COMP9415 thanks'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'course_outline_queries_with_followup-user_input_course_code' or 'course_outline_queries'
    assert result.message == 'COMP9415'

    time.sleep(TIME_BETWEEN_API)
def test_course_fee_queries_followup_1():
    query_module = QueryModule()

    test_message = 'I want to find out the course fee for a course'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'course_fee_queries_with_followup'
    assert result.message == 'Sure! What is the course code of the course you want to know course fee for?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = 'COMP9900 thanks'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'course_fee_queries_with_followup-user_input_course_code' or 'course_fee_queries'
    assert result.message == 'COMP9900'

    time.sleep(TIME_BETWEEN_API)
def test_indicative_hours_queries_followup():
    query_module = QueryModule()

    test_message = 'I want to find the workload for a course'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'indicative_hours_queries_with_followup'
    assert result.message == 'Of course! What is the course code of the course you want to know the indicative hours for?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = 'COMP9517'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'indicative_hours_queries_with_followup-user_input_course_code' or 'indicative_hours_queries'
    assert result.message == 'COMP9517'

    time.sleep(TIME_BETWEEN_API)
Beispiel #7
0
def test_consultation_booking_command_3():
    query_module = QueryModule()
    test_messages = [
        'I want to book a course consultation on 1/11/19 at 06:13 for COMP9334?',
        'May I book the time slot starts from 1/11/19 06:13 for COMP9334?',
        'May I book the time slot starts from 06:13 on 1/11/19 for COMP9334?',
        'Show me the available time slot on 1/11/2019 at 06:13 for COMP9334',
        'Reserve the time slot starts from 2019/11/1 6:13 for COMP9334',
        'Book consultation for COMP9334 on 1/11/2019 at 6:13',
        'Make a consultation booking for COMP9334 on 1/11/19 at 6:13',
        'Make a consultation booking on 2019/11/1 at 6:13 for COMP9334',
        'Make consultation booking for COMP9334 on 1/11/19 at 6:13',
        'May I book the time slot starts from 1/11/2019 6:13 for COMP9334?',
        'Book an consultation for COMP9334 on 1/11/2019 at 6:13',
        'May I book a consultation for COMP9334 at 1/11/2019 6:13',
        'May I book consultation for COMP9334 from 1/11/2019 6:13',
        'May I book a consultation for COMP9334 on 2019/11/1 at 6:13',
        'Reserve a course consultation for COmp9334 on 1/11/2019 at 6:13'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'consultation_booking'
        assert result.message.upper() == 'COMP9334 @@@ 06:13:00 @@@ 2019-11-01'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
def test_offering_term_queries_followup():
    query_module = QueryModule()

    test_message = 'I want to know when I can take a course'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'offering_term_queries_with_followup'
    assert result.message == 'Of course! What is the course code of the course you want to know the offering terms for?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = 'COMP9318'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'offering_term_queries_with_followup-user_input_course_code' or 'offering_term_queries'
    assert result.message == 'COMP9318'

    time.sleep(TIME_BETWEEN_API)
Beispiel #9
0
def test_wam_student_queries():
    query_module = QueryModule()
    test_messages = [
        'I want to know my grades', 'Tell me about my WAM',
        "Tell me about my grades", 'Show me my course results', 'My wam',
        'What is my WAM', 'What are my grades right now?'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'wam_student_queries'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #10
0
def test_course_timetable_queries():
    query_module = QueryModule()
    test_messages = [
        'I want to see COMP9321 timetable', 'Timetable for COMP9321',
        "Tell me COMP9321's timetable", 'Show me COMP9321 timetable',
        'COMP9321 timetable', 'When are the classes for COMP9321',
        'Give me the timetable for comp9321 thanks'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'course_timetable_queries'
        assert result.message.upper() == 'COMP9321'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #11
0
def test_course_fee_queries():
    query_module = QueryModule()
    test_messages = [
        'How much is COMP9318?', 'Cost of COMP9318??', "COMP9318's cost?",
        "How much is COMP9318's course fee?",
        'How much do I need to pay for COMP9318', 'The cost of COMP9318???',
        'Course fee for COMP9318 thanks'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'course_fee_queries'
        assert result.message.upper() == 'COMP9318'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
def test_consultation_booking_user_input_time_date_first_followup_2():
    query_module = QueryModule()

    test_message = 'Please book a course consultation for me'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup'
    assert result.message == 'Sure! What is the course code of the course you would like to book it for? Also, what time and date?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "Make a booking at 11am on 04/09/19"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup-user_input_time_and_date_with_followup'
    assert result.message == 'Sure! Please tell me the course code of the course you want to book consultation for?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "COMP9020"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup-user_input_time_and_date_with_followup-user_input_course_code'
    assert result.message == 'COMP9020 @@@ 11:00:00 @@@ 2019-09-04'

    time.sleep(TIME_BETWEEN_API)
def test_consultation_booking_user_input_course_code_first_followup_2():
    query_module = QueryModule()

    test_message = 'Book a course consultation'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup'
    assert result.message == 'Sure! What is the course code of the course you would like to book it for? Also, what time and date?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "COMP9101"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup-user_input_course_code_with_followup'
    assert result.message == 'Sure! Please tell me which date and time you would like to book a course consultation for COMP9101.'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "3:30pm on 2/11/2019"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup-user_input_course_code_with_followup-user_input_time_and_date'
    assert result.message == 'COMP9101 @@@ 15:30:00 @@@ 2019-11-02'

    time.sleep(TIME_BETWEEN_API)
def test_consultation_booking_user_input_time_date_first_followup_1():
    query_module = QueryModule()

    test_message = 'Book a consultation'
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup'
    assert result.message == 'Sure! What is the course code of the course you would like to book it for? Also, what time and date?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "Book 10:15 on 2/3/2019"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup-user_input_time_and_date_with_followup'
    assert result.message == 'Sure! Please tell me the course code of the course you want to book consultation for?'

    time.sleep(TIME_BETWEEN_CONTEXT)

    test_message = "COMP9336"
    result = query_module.detect_intent_texts(test_message)
    assert result.intent == 'consultation_booking_with_followup-user_input_time_and_date_with_followup-user_input_course_code'
    assert result.message == 'COMP9336 @@@ 10:15:00 @@@ 2019-03-02'

    time.sleep(TIME_BETWEEN_API)
Beispiel #15
0
def test_course_location_queries():
    query_module = QueryModule()
    test_messages = [
        'Where is COMP9321?', 'Where is COMP9321 at?', "COMP9321's campus?",
        'Where is COMP9321 offered?',
        'Which campus is COMP9321 going to be in?', 'Where to go for COMP9321',
        'Campus for COMP9321?'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'course_location_queries'
        assert result.message.upper() == 'COMP9321'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #16
0
def test_indicative_hours_queries():
    query_module = QueryModule()
    test_messages = [
        'How long will I spend on COMP9517?', 'Indicative hour for COMP9517??',
        'Work load for COMP9517??', 'Number of hours for COMP9517',
        'Expected workload for COMP9517',
        'Give me the indicative hours for COMP9517',
        'How many hours a week for COMP9517'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'indicative_hours_queries'
        assert result.message.upper() == 'COMP9517'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #17
0
def test_all_courses_queries():
    query_module = QueryModule()
    test_messages = [
        'I wanna know all the courses of postgraduate',
        'I want to know the list of postgraduate courses',
        "I want to get all the courses of postgraduate",
        'I want to get all the courses', 'Can I get all postgraduate courses',
        'Can I know all postgraduate courses', 'Can you show me all courses'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'all_courses_queries'
        assert result.message == 'Sure! These are all the courses of CSE!'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #18
0
def test_wam_admin_queries():
    query_module = QueryModule()
    test_messages = [
        'I want to know the wam of z1234567',
        'I want to get the wam of z1234567', "Can I get the wam for z1234567",
        'Can I know the wam for z1234567',
        'Please tell me the wam for z1234567', 'Show me the wam for z1234567',
        'The wam of z1234567'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'wam_admin_queries'
        assert result.message == 'z1234567'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #19
0
def test_announcement_queries():
    query_module = QueryModule()
    test_messages = [
        'COMP9900 announcement', "COMP9900's announcement",
        "Show me COMP9900's announcement", 'Give me COMP9900 announcement',
        'announcement for COMP9900',
        'What is the latest announcement for COMP9900',
        'Give me the announcement for COMP9900 thanks'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'announcement_queries'
        assert result.message.upper() == 'COMP9900'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #20
0
def test_offering_term_queries():
    query_module = QueryModule()
    test_messages = [
        'When is COMP9101 offered?', 'When can I take COMP9101',
        "What are COMP9101's offering term",
        'Which semester can I take comp9101?',
        'Which semester is comp9101 offered in',
        'Can I take COMP9101 in semester 1?', 'When can I enroll in COMP9101?'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'offering_term_queries'
        assert result.message.upper() == 'COMP9101'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #21
0
def test_adk_queries():
    query_module = QueryModule()
    test_messages = [
        'Could you please tell me COMP9900 a ADK or not', "ADK COMP9900?",
        "COMP9900 ADK?", 'Tell me if COMP9900 a ADK course or not',
        'Could you please tell me COMP9900 a ADK or not',
        'Could you please tell me if COMP9900 an ADK',
        'Could you please tell me if COMP9900 a ADK or not?'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'adk_course_queries'
        assert result.message.upper() == 'COMP9900'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #22
0
def test_course_outline_queries():
    query_module = QueryModule()
    test_messages = [
        'What is the outline for COMP9900?', 'What is COMP9900 about?',
        'What is COMP9900 about?', 'Tell me more about COMP9900',
        'Give me the outline for comp9900',
        'Course description for COMP9900 thanks',
        'What can I learn in COMP9900?'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'course_outline_queries'
        assert result.message.upper() == 'COMP9900'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #23
0
def test_consultation_view():
    query_module = QueryModule()
    test_messages = [
        'May I check my consultation booking',
        'What are my consultation bookings right now?',
        'I want to see my list of consultation bookings',
        'Show me my consultation booking', 'View my consultation bookings',
        'Check my consultation bookings', 'See my consultation bookings',
        'Show me my consultation booking history '
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'consultation_view'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #24
0
def test_send_outline_queries():
    query_module = QueryModule()
    test_messages = [
        'Email me the outline for COMP9331',
        'Send me the pdf outline for Comp9331',
        "Send me comp9331's course outline pdf",
        'Provide me the outline for COMP9331',
        'Provide me the course outline for COMP9331 thanks',
        'Provide me the course outline pdf for COMP9331 thanks'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'send_outline_queries'
        assert result.message.upper() == 'COMP9331'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #25
0
def test_prerequisites_queries():
    query_module = QueryModule()
    test_messages = [
        'Prerequisites for COMP9444', 'Prerequisites for COMP9444??',
        'What courses do I need to take before COMP9444??',
        "COMP9444's prerequisites", 'What are the prerequisites for COMP9444',
        'Requirements for COMP9444', "COMP9444's requirements",
        'Are there any classes I need to take before doing COMP9444?',
        'Give me the prerequisites for COMP9444',
        'What are the prerequisites for COMP9444??',
        'What are the requirements for COMP9444??'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'prerequisites_queries'
        assert result.message.upper() == 'COMP9444'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded
Beispiel #26
0
def test_consultation_cancelling_command():
    query_module = QueryModule()
    test_messages = [
        'Cancel my booking for COMP9334 at 06:45 at on 20/05/2019',
        'Cancel my appointment with LiC for COMP9334 at 20/05/2019 06:45',
        'Please cancel my consultation for COMP9334 at 06:45 on 20/05/19',
        'Cancel my consultation at 06:45 on 20/05/19 for COMP9334',
        'Can I cancel the consultation for COMP9334 on 20/05/19 06:45?',
        'Can I cancel my consultation for COMP9334 at 06:45 on 20/05/2019?',
        'Cancel course consultation booking for COMP9334 at 06:45 20/05/19',
        'Cancel booking for COMP9334 on 06:45 20/05/19',
        'Cancel my course consultation for COMP9334 at 06:45 on 20/05/19',
        'I want to cancel my course consultation booking for COMP9334 on 20/05/19 at 06:45'
    ]
    for test_message in test_messages:
        result = query_module.detect_intent_texts(test_message)
        assert result.intent == 'consultation_cancel'
        assert result.message.upper() == 'COMP9334 @@@ 06:45:00 @@@ 2019-05-20'
        time.sleep(
            TIME_BETWEEN_API)  # set gap so Google API doesn't get overloaded