Backend state migration #4735
74 fail, 2 skipped, 80 pass in 39s
Annotations
Check warning on line 0 in algorithms.tests.test_autoplanning
github-actions / Test Results
test_basic_CS_autoplanning (algorithms.tests.test_autoplanning) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
ValueError: your courses are impossible to put in these terms! Error code: 3
def test_basic_CS_autoplanning():
> assert_autoplanning_guarantees(
[
12, 20, 20, 20, 12, 20, 20, 20, 10, 20, 20, 20
],
[
Course("MATH1141", CONDITIONS["MATH1141"], 65, 6, {2020: [1, 3], 2021: [1, 3], 2022: [1, 3]}),
Course("MATH1081", CONDITIONS["MATH1081"], 65, 6, {2020: [1, 2, 3], 2021: [1, 2, 3], 2022: [1, 2, 3]}),
Course("COMP1511", CONDITIONS["COMP1511"], 65, 6, {2020: [1, 2, 3], 2021: [1, 2, 3], 2022: [1, 2, 3]}),
Course("COMP2521", CONDITIONS["COMP2521"], 65, 6, {2020: [2, 3], 2021: [2, 3], 2022: [2, 3]}),
Course("COMP2041", CONDITIONS["COMP2041"], 65, 6, {2020: [2], 2021: [2], 2022: [2]}),
Course("COMP1531", CONDITIONS["COMP1531"], 65, 6, {2020: [1, 3], 2021: [1, 3], 2022: [1, 3]}),
Course("COMP1521", CONDITIONS["COMP1521"], 65, 6, {2020: [1, 2], 2021: [1, 2], 2022: [1, 2]}),
Course("ENGG2600", CONDITIONS["ENGG2600"], 65, 2, {2020: [1, 2, 3], 2021: [1, 2, 3], 2022: [1, 2, 3]}),
Course("ENGG2600", CONDITIONS["ENGG2600"], 65, 2, {2020: [1, 2, 3], 2021: [1, 2, 3], 2022: [1, 2, 3]}),
Course("ENGG2600", CONDITIONS["ENGG2600"], 65, 2, {2020: [1, 2, 3], 2021: [1, 2, 3], 2022: [1, 2, 3]}),
Course("COMP2511", CONDITIONS["COMP2511"], 65, 6, {2020: [2, 3], 2021: [2, 3], 2022: [2, 3]}),
Course("MATH1241", CONDITIONS["MATH1241"], 65, 6, {2020: [2, 3], 2021: [2, 3], 2022: [2, 3]}),
Course("MATH3411", CONDITIONS["MATH3411"], 65, 6, {2020: [3], 2021: [3], 2022: [3]}),
Course("COMP3411", CONDITIONS["COMP3411"], 65, 6, {2020: [3], 2021: [0], 2022: [0]}),
Course("COMP6841", CONDITIONS["COMP6841"], 65, 6, {2020: [1], 2021: [1], 2022: [1]}),
Course("COMP3231", CONDITIONS["COMP3231"], 65, 6, {2020: [1], 2021: [1], 2022: [1]}),
Course("COMP3141", CONDITIONS["COMP3141"], 65, 6, {2020: [2], 2021: [2], 2022: [2]}),
Course("COMP3121", CONDITIONS["COMP3121"], 65, 6, {2020: [2, 3], 2021: [2, 3], 2022: [2, 3]}),
Course("COMP3131", CONDITIONS["COMP3131"], 65, 6, {2020: [1], 2021: [1], 2022: [1]}),
Course("COMP4141", CONDITIONS["COMP4141"], 65, 6, {2020: [1], 2021: [1], 2022: [1]}),
Course("COMP3901", CONDITIONS["COMP3901"], 65, 6, {2020: [1, 2, 3], 2021: [1, 2, 3], 2022: [1, 2, 3]}), # cores conditions
Course("ARTS1360", CONDITIONS["ARTS1360"], 65, 6, {2020: [2], 2021: [2], 2022: [2]}),
],
"3778",
["COMPA1"]
)
algorithms/tests/test_autoplanning.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
algorithms/tests/test_autoplanning.py:116: in assert_autoplanning_guarantees
res = autoplan(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
courses = [Course(name='MATH1141', condition={"logic": "and", "id": "start", "children": [{"exclusion": "DPST1013"}, {"exclusion...OMP1917"}, {"id": "COMP1921"}]}]}, mark=65, uoc=6, terms={2020: [1, 3], 2021: [1, 3], 2022: [1, 3]}, locked=None), ...]
user = <algorithms.objects.user.User object at 0x7f6fc5643aa0>
start = (2020, 0), end = (2023, 3), uoc_max = [12, 20, 20, 20, 12, 20, ...]
def autoplan(courses: list[Course], user: User, start: Tuple[int, int], end: Tuple[int, int], uoc_max: list[int]) -> list[Tuple[str, Tuple[int, int]]]:
"""
given a list of courses, we will fill our terms in a valid ordering.
we will enforce that:
- the course must be offered in that term
- duplicate courses (usually only multiterm courses) must be taken consecutively
- the UOC max for each term is adhered to (no overloading, and the user should be allowed to manipulate this)
- the prerequisites are respected.
"""
# TODO: add a way to lock in courses
model = cp_model.CpModel()
# 1. enforces terms
variables = [model.NewIntVarFromDomain(cp_model.Domain.FromIntervals(course.term_domain(start, end)), course.name) for course in courses]
# 2. if any courses are named the same, then they must be taken consecutively
possible_course_dupes = [course.name for course in courses if not course.locked]
duplicate_courses = set(c for c in possible_course_dupes if possible_course_dupes.count(c) > 1)
for dupe in duplicate_courses:
matched_courses = [variable for variable in variables if variable.Name() == dupe]
for match, next_match in zip(matched_courses, matched_courses[1:]):
model.Add(match + 1 == next_match)
# 3. set max UOC for a term
for index, m in enumerate(uoc_max):
boolean_indexes = []
for v in variables:
# b is a 'channeling constraint'. This is done to fill the resovoir only *if* the course is in that given term
# https://developers.google.com/optimization/cp/channeling
b = model.NewBoolVar('hi')
model.Add(v == index).OnlyEnforceIf(b)
model.Add(v != index).OnlyEnforceIf(b.Not())
boolean_indexes.append(b)
# if the course is in term 'index', only allow 0 to m UOC to exist in that term.
model.AddReservoirConstraintWithActive(
variables,
list(map_var_to_course(courses, var).uoc for var in variables), # this fills the resovoir by UoC units if active
boolean_indexes, # a course is only active if in term 'index'
0,
m # uoc_max
)
# 4. enforce prereqs, only if not locked by user
for course in courses:
if course.locked:
continue
# this is the responsibility of the condition class to generate prereq model.
course.condition.condition_to_model(
model,
user,
list((variable, map_var_to_course(courses, variable)) for variable in variables),
map_course_to_var(course, variables)
)
solver = cp_model.CpSolver()
status = solver.Solve(model)
if status in [cp_model.MODEL_INVALID, cp_model.INFEASIBLE]:
> raise ValueError(f'your courses are impossible to put in these terms! Error code: {status}')
E ValueError: your courses are impossible to put in these terms! Error code: 3
algorithms/autoplanning.py:80: ValueError
Check warning on line 0 in algorithms.tests.test_conditions
github-actions / Test Results
test_wam_condition_simple (algorithms.tests.test_conditions) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 0 == 1
+ where 0 = len([])
def test_wam_condition_simple():
'''Testing simple wam condition without complex keywords. We must check for
warnings since we will return True by default'''
user = User(USERS["user3"])
user.add_courses({
"COMP1511": (6, None),
"COMP1521": (6, None)
})
cond1 = create_condition(["(", "70WAM", ")"])
cond1_user_unlocked = cond1.validate(user)
assert cond1_user_unlocked[0]
assert len(cond1_user_unlocked[1]) == 1
assert "Requires 70 WAM in all courses. Your WAM in all courses has not been recorded" in cond1_user_unlocked[1]
user1 = User(USERS["user3"])
user1.add_courses({
"COMP1511": (6, 80),
"COMP1521": (6, 90),
"COMP1531": (6, 100)
})
cond1_user1_unlocked = cond1.validate(user1)
assert cond1_user1_unlocked[0]
> assert len(cond1_user1_unlocked[1]) == 1
E assert 0 == 1
E + where 0 = len([])
algorithms/tests/test_conditions.py:163: AssertionError
Check warning on line 0 in algorithms.tests.test_conditions
github-actions / Test Results
test_wam_condition_complex (algorithms.tests.test_conditions) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert False
def test_wam_condition_complex():
'''Testing wam condition including keywords'''
user = User(USERS["user3"])
user.add_courses({
"COMP1511": (6, None),
"COMP1521": (6, None),
"MATH1131": (6, None),
"MATH1141": (6, None),
})
comp_cond_70 = create_condition(["(", "70WAM", "in", "COMP", ")"])
assert (comp_cond_70.validate(user))[0]
math_cond_70 = create_condition(["(", "70WAM", "in", "MATH", ")"])
assert (math_cond_70.validate(user))[0]
comp_math_cond_70 = create_condition(
["(", "70WAM", "in", "COMP", "||", "70WAM", "in", "MATH", ")"])
assert (comp_math_cond_70.validate(user))[0]
user1 = User(USERS["user3"])
user1.add_courses({
"COMP1511": (6, 65),
"COMP1521": (6, 80),
"MATH1131": (6, 50),
"MATH1141": (6, 50),
})
assert (comp_cond_70.validate(user1))[0]
> assert (math_cond_70.validate(user1))[0]
E assert False
algorithms/tests/test_conditions.py:207: AssertionError
Check warning on line 0 in server.tests.courses.test_courses_unlocked_when_taken
github-actions / Test Results
test_no_courses_completed (server.tests.courses.test_courses_unlocked_when_taken) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
AssertionError: assert {'detail': [{..._forbidden'}]} == {'direct_unlo... ['DPST1093']}
Left contains 1 more item:
{'detail': [{'input': {'COMP1521': [6, 57], 'COMP1531': [6, 57]},
'loc': ['body', 'core_courses'],
'msg': 'Extra inputs are not permitted',
'type': 'extra_forbidden'}]}
Right contains 2 more items:
{'direct_unlock': ['COMP1521',
'COMP1531',
'COMP2041',
'COMP2121',
'COMP2521',
'COMP9334'],
'indirect_unlock': ['DPST1093']}
Full diff:
{
- 'direct_unlock': ['COMP1521',
+ 'detail': [{'input': {'COMP1521': [6,
+ 57],
- 'COMP1531',
+ 'COMP1531': [6,
? ++++ ++++
- 'COMP2041',
- 'COMP2121',
- 'COMP2521',
- 'COMP9334'],
- 'indirect_unlock': ['DPST1093'],
+ 57]},
+ 'loc': ['body',
+ 'core_courses'],
+ 'msg': 'Extra inputs are not permitted',
+ 'type': 'extra_forbidden'}],
}
def test_no_courses_completed():
x = requests.post(
'http://127.0.0.1:8000/courses/coursesUnlockedWhenTaken/COMP1511', json=USERS["user3"])
> assert x.json() == {
"direct_unlock": [
'COMP1521',
'COMP1531',
'COMP2041',
'COMP2121',
'COMP2521',
'COMP9334'
],
# COMP1511 is equivalent to 'DPST1091' so it unlocks DPST1093
# Maybe "equivalent" courses should be under `direct_unlock`?
"indirect_unlock": ["DPST1093"]
}
E AssertionError: assert {'detail': [{..._forbidden'}]} == {'direct_unlo... ['DPST1093']}
E Left contains 1 more item:
E {'detail': [{'input': {'COMP1521': [6, 57], 'COMP1531': [6, 57]},
E 'loc': ['body', 'core_courses'],
E 'msg': 'Extra inputs are not permitted',
E 'type': 'extra_forbidden'}]}
E Right contains 2 more items:
E {'direct_unlock': ['COMP1521',
E 'COMP1531',
E 'COMP2041',
E 'COMP2121',
E 'COMP2521',
E 'COMP9334'],
E 'indirect_unlock': ['DPST1093']}
E Full diff:
E {
E - 'direct_unlock': ['COMP1521',
E + 'detail': [{'input': {'COMP1521': [6,
E + 57],
E - 'COMP1531',
E + 'COMP1531': [6,
E ? ++++ ++++
E - 'COMP2041',
E - 'COMP2121',
E - 'COMP2521',
E - 'COMP9334'],
E - 'indirect_unlock': ['DPST1093'],
E + 57]},
E + 'loc': ['body',
E + 'core_courses'],
E + 'msg': 'Extra inputs are not permitted',
E + 'type': 'extra_forbidden'}],
E }
server/tests/courses/test_courses_unlocked_when_taken.py:15: AssertionError
Check warning on line 0 in server.tests.courses.test_courses_unlocked_when_taken
github-actions / Test Results
test_malformed_request (server.tests.courses.test_courses_unlocked_when_taken) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 422 == 400
+ where 422 = <Response [422]>.status_code
def test_malformed_request():
x = requests.post(
'http://127.0.0.1:8000/courses/coursesUnlockedWhenTaken/&&&&&', json=USERS["user3"])
> assert x.status_code == 400
E assert 422 == 400
E + where 422 = <Response [422]>.status_code
server/tests/courses/test_courses_unlocked_when_taken.py:33: AssertionError
Check warning on line 0 in server.tests.courses.test_courses_unlocked_when_taken
github-actions / Test Results
test_two_courses_completed (server.tests.courses.test_courses_unlocked_when_taken) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
AssertionError: assert {'direct_unlo..., 'TABL2710']} == {'direct_unlo... ['TABL2710']}
Omitting 1 identical items, use -vv to show
Differing items:
{'indirect_unlock': ['BABS3301', 'SOMS3001', 'TABL2710']} != {'indirect_unlock': ['TABL2710']}
Full diff:
{
'direct_unlock': ['COMP3121',
'COMP3141',
'COMP3151',
'COMP3161',
'COMP3231',
'COMP3311',
'COMP3331',
'COMP3411',
'COMP3431',
'COMP3821',
'COMP3891',
'COMP6451',
'COMP6714',
'COMP6991',
'COMP9319',
'COMP9417',
'COMP9444',
'COMP9517',
'COMP9727'],
- 'indirect_unlock': ['TABL2710'],
+ 'indirect_unlock': ['BABS3301', 'SOMS3001', 'TABL2710'],
}
def test_two_courses_completed():
x = requests.post(
'http://127.0.0.1:8000/courses/coursesUnlockedWhenTaken/COMP2521', json=USERS["user1"])
# TABL2710 is unlocked because USER1 now meets the 18UOC requirement
> assert x.json() == {
"direct_unlock": [
"COMP3121",
"COMP3141",
"COMP3151",
"COMP3161",
"COMP3231",
"COMP3311",
"COMP3331",
"COMP3411",
"COMP3431",
"COMP3821",
"COMP3891",
"COMP6451",
"COMP6714",
"COMP6991",
"COMP9319",
"COMP9417",
"COMP9444",
"COMP9517",
"COMP9727",
],
"indirect_unlock": ["TABL2710"]
}
E AssertionError: assert {'direct_unlo..., 'TABL2710']} == {'direct_unlo... ['TABL2710']}
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'indirect_unlock': ['BABS3301', 'SOMS3001', 'TABL2710']} != {'indirect_unlock': ['TABL2710']}
E Full diff:
E {
E 'direct_unlock': ['COMP3121',
E 'COMP3141',
E 'COMP3151',
E 'COMP3161',
E 'COMP3231',
E 'COMP3311',
E 'COMP3331',
E 'COMP3411',
E 'COMP3431',
E 'COMP3821',
E 'COMP3891',
E 'COMP6451',
E 'COMP6714',
E 'COMP6991',
E 'COMP9319',
E 'COMP9417',
E 'COMP9444',
E 'COMP9517',
E 'COMP9727'],
E - 'indirect_unlock': ['TABL2710'],
E + 'indirect_unlock': ['BABS3301', 'SOMS3001', 'TABL2710'],
E }
server/tests/courses/test_courses_unlocked_when_taken.py:43: AssertionError
Check warning on line 0 in server.tests.courses.test_get_all_unlocked
github-actions / Test Results
test_fix_wam_only_unlock_given_course (server.tests.courses.test_get_all_unlocked) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
KeyError: 'courses_state'
def test_fix_wam_only_unlock_given_course():
x = requests.post(
"http://127.0.0.1:8000/courses/getAllUnlocked", json=USERS["user5"]
)
assert x.status_code != 500
> assert x.json()["courses_state"]["COMP1521"]["unlocked"] is True
E KeyError: 'courses_state'
server/tests/courses/test_get_all_unlocked.py:16: KeyError
Check warning on line 0 in server.tests.courses.test_get_all_unlocked
github-actions / Test Results
test_unlock_dependent_course (server.tests.courses.test_get_all_unlocked) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
KeyError: 'courses_state'
def test_unlock_dependent_course():
x = requests.post(
"http://127.0.0.1:8000/courses/getAllUnlocked", json=USERS["user2"]
)
assert x.status_code != 500
> assert x.json()["courses_state"]["MATH1231"]["unlocked"] is True
E KeyError: 'courses_state'
server/tests/courses/test_get_all_unlocked.py:25: KeyError
Check warning on line 0 in server.tests.courses.test_search_course
github-actions / Test Results
test_search_course (server.tests.courses.test_search_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 200
+ where 401 = <Response [401]>.status_code
def test_search_course():
x = requests.post('http://127.0.0.1:8000/courses/searchCourse/COMP1', json=USER)
> assert x.status_code == 200
E assert 401 == 200
E + where 401 = <Response [401]>.status_code
server/tests/courses/test_search_course.py:14: AssertionError
Check warning on line 0 in server.tests.courses.test_search_course
github-actions / Test Results
test_search_archives (server.tests.courses.test_search_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 200
+ where 401 = <Response [401]>.status_code
def test_search_archives():
x = requests.post('http://127.0.0.1:8000/courses/searchCourse/DESN1000', json=USER)
> assert x.status_code == 200
E assert 401 == 200
E + where 401 = <Response [401]>.status_code
server/tests/courses/test_search_course.py:20: AssertionError
Check warning on line 0 in server.tests.courses.test_search_course
github-actions / Test Results
test_search_title (server.tests.courses.test_search_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 200
+ where 401 = <Response [401]>.status_code
def test_search_title():
x = requests.post('http://127.0.0.1:8000/courses/searchCourse/Programming Fundamentals', json=USER)
> assert x.status_code == 200
E assert 401 == 200
E + where 401 = <Response [401]>.status_code
server/tests/courses/test_search_course.py:26: AssertionError
Check warning on line 0 in server.tests.courses.test_search_course
github-actions / Test Results
test_search_minor (server.tests.courses.test_search_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 200
+ where 401 = <Response [401]>.status_code
def test_search_minor():
x = requests.post('http://127.0.0.1:8000/courses/searchCourse/Financial Fundamentals', json=USER)
> assert x.status_code == 200
E assert 401 == 200
E + where 401 = <Response [401]>.status_code
server/tests/courses/test_search_course.py:32: AssertionError
Check warning on line 0 in server.tests.courses.test_terms_offered
github-actions / Test Results
test_term_offered_comp1511_bad_years_past (server.tests.courses.test_terms_offered) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 500 == 200
+ where 500 = <Response [500]>.status_code
def test_term_offered_comp1511_bad_years_past():
res = requests.get(f"http://127.0.0.1:8000/courses/termsOffered/COMP1511/2001")
> assert res.status_code == 200
E assert 500 == 200
E + where 500 = <Response [500]>.status_code
server/tests/courses/test_terms_offered.py:29: AssertionError
Check warning on line 0 in server.tests.courses.test_terms_offered
github-actions / Test Results
test_term_offered_fake_course (server.tests.courses.test_terms_offered) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 500 == 200
+ where 500 = <Response [500]>.status_code
def test_term_offered_fake_course():
res = requests.get("http://127.0.0.1:8000/courses/termsOffered/CODEXXXX/2020+2021+2022")
> assert res.status_code == 200
E assert 500 == 200
E + where 500 = <Response [500]>.status_code
server/tests/courses/test_terms_offered.py:49: AssertionError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_add_to_unplanned (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 200
+ where 401 = <Response [401]>.status_code
def test_add_to_unplanned():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["empty_year"]) # set to empty planner
data = {
'courseCode': 'COMP1511'
}
x = requests.post('http://127.0.0.1:8000/planner/addToUnplanned', json=data)
> assert x.status_code == 200
E assert 401 == 200
E + where 401 = <Response [401]>.status_code
server/tests/planner/test_moving_course.py:21: AssertionError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_invalid_add_to_unplanned (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 200
+ where 401 = <Response [401]>.status_code
def test_invalid_add_to_unplanned():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["empty_year"]) # set to empty planner
data = {
'courseCode': 'COMP1511'
}
x = requests.post('http://127.0.0.1:8000/planner/addToUnplanned', json=data)
> assert x.status_code == 200
E assert 401 == 200
E + where 401 = <Response [401]>.status_code
server/tests/planner/test_moving_course.py:36: AssertionError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_unplanned_to_term (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 200
+ where 401 = <Response [401]>.status_code
def test_unplanned_to_term():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["simple_year"])
data = {
'destRow': 0,
'destTerm': 'T3',
'destIndex': 1,
'courseCode': 'COMP6447'
}
x = requests.post('http://127.0.0.1:8000/planner/unPlannedToTerm', json=data)
> assert x.status_code == 200
E assert 401 == 200
E + where 401 = <Response [401]>.status_code
server/tests/planner/test_moving_course.py:55: AssertionError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_unplanned_to_term_multiterm (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 200
+ where 401 = <Response [401]>.status_code
def test_unplanned_to_term_multiterm():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["empty_year"])
data = {'courseCode': 'ENGG2600'}
requests.post('http://127.0.0.1:8000/planner/addToUnplanned', json=data)
data = {
'destRow': 0,
'destTerm': 'T3',
'destIndex': 0,
'courseCode': 'ENGG2600'
}
x = requests.post('http://127.0.0.1:8000/planner/unPlannedToTerm', json=data)
> assert x.status_code == 200
E assert 401 == 200
E + where 401 = <Response [401]>.status_code
server/tests/planner/test_moving_course.py:74: AssertionError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_invalid_unplanned_to_term_multiterm (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 400
+ where 401 = <Response [401]>.status_code
def test_invalid_unplanned_to_term_multiterm():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["empty_year"])
data = {'courseCode': 'ENGG2600'}
requests.post('http://127.0.0.1:8000/planner/addToUnplanned', json=data)
data = {
'destRow': 2,
'destTerm': 'T3',
'destIndex': 0,
'courseCode': 'ENGG2600'
}
x = requests.post('http://127.0.0.1:8000/planner/unPlannedToTerm', json=data)
> assert x.status_code == 400
E assert 401 == 400
E + where 401 = <Response [401]>.status_code
server/tests/planner/test_moving_course.py:95: AssertionError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_planned_to_term (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
KeyError: 'planner'
def test_planned_to_term():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["simple_year"])
data = requests.get(f'http://127.0.0.1:8000/user/data/all/{DUMMY_TOKEN}').json()
> assert "COMP2521" in data['planner']['years'][0]['T2']
E KeyError: 'planner'
server/tests/planner/test_moving_course.py:101: KeyError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_planned_to_term_multiterm (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
KeyError: 'planner'
def test_planned_to_term_multiterm():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["simple_year"])
data = requests.get(f'http://127.0.0.1:8000/user/data/all/{DUMMY_TOKEN}').json()
> assert "ENGG2600" in data['planner']['years'][1]['T3']
E KeyError: 'planner'
server/tests/planner/test_moving_course.py:122: KeyError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_invalid_planned_to_term (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
assert 401 == 400
+ where 401 = <Response [401]>.status_code
def test_invalid_planned_to_term():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["simple_year"])
data = {
'srcRow': 1,
'srcTerm': 'T3',
'destRow': 0,
'destTerm': 'T2',
'destIndex': 0,
'courseCode': 'ENGG2600'
}
x = requests.post('http://127.0.0.1:8000/planner/plannedToTerm', json=data)
> assert x.status_code == 400
E assert 401 == 400
E + where 401 = <Response [401]>.status_code
server/tests/planner/test_moving_course.py:156: AssertionError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_remove_unplanned_course (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
KeyError: 'planner'
def test_remove_unplanned_course():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["simple_year"])
data = requests.get(f'http://127.0.0.1:8000/user/data/all/{DUMMY_TOKEN}').json()
> assert "COMP6447" in data['planner']['unplanned']
E KeyError: 'planner'
server/tests/planner/test_moving_course.py:162: KeyError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_remove_planned_course (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
KeyError: 'planner'
def test_remove_planned_course():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["simple_year"])
data = requests.get(f'http://127.0.0.1:8000/user/data/all/{DUMMY_TOKEN}').json()
> assert "MATH1081" in data['planner']['years'][0]['T1']
E KeyError: 'planner'
server/tests/planner/test_moving_course.py:175: KeyError
Check warning on line 0 in server.tests.planner.test_moving_course
github-actions / Test Results
test_remove_all_courses (server.tests.planner.test_moving_course) failed
artifacts/be-test-results/be-test-results.xml [took 0s]
Raw output
KeyError: 'planner'
def test_remove_all_courses():
clear()
requests.post('http://127.0.0.1:8000/user/saveLocalStorage', json=DATA["simple_year"])
data = requests.get(f'http://127.0.0.1:8000/user/data/all/{DUMMY_TOKEN}').json()
> assert "COMP6447" in data['planner']['unplanned']
E KeyError: 'planner'
server/tests/planner/test_moving_course.py:189: KeyError