@@ -177,10 +177,10 @@ def test_post_association_group(clean_firestore):
177
177
178
178
def test_post_association_group_negative (clean_firestore ):
179
179
# Create learner association group:
180
- active_cp = create_curriculum_pathway (
180
+ active_cp = create_curriculum_pathway (
181
181
payload = {** BASIC_CURRICULUM_PATHWAY_EXAMPLE ,
182
182
"is_active" : True , "alias" : "program" ,
183
- "is_deleted" : False })
183
+ "is_deleted" : False })
184
184
input_group = {** BASIC_ASSOCIATION_GROUP_EXAMPLE , "name" : "Learner Group1" }
185
185
url = api_url
186
186
post_resp = client_with_emulator .post (url , json = input_group )
@@ -437,7 +437,7 @@ def test_update_association_status_2(clean_firestore):
437
437
discipline_group .users = [{"user" : user_2 .user_id , "status" : "active" }]
438
438
discipline_group .associations = {
439
439
"curriculum_pathways" : [{
440
- "curriculum_pathway_id" : curriculum_pathway_id , "status" : "active"
440
+ "curriculum_pathway_id" : curriculum_pathway_id , "status" : "active"
441
441
}]
442
442
}
443
443
discipline_group .update ()
@@ -468,7 +468,7 @@ def test_update_association_status_2(clean_firestore):
468
468
url = f"{ api_url } /{ association_group_uuid } /user-association/status"
469
469
request_body = {
470
470
"instructor" : {"instructor_id" : user_2 .user_id ,
471
- "curriculum_pathway_id" :curriculum_pathway_id ,
471
+ "curriculum_pathway_id" : curriculum_pathway_id ,
472
472
"status" : "active" }
473
473
}
474
474
@@ -615,7 +615,7 @@ def test_update_association_status_negative_3(clean_firestore):
615
615
discipline_group .users = [{"user" : user_2 .user_id , "status" : "inactive" }]
616
616
discipline_group .associations = {
617
617
"curriculum_pathways" : [{
618
- "curriculum_pathway_id" : curriculum_pathway_id , "status" : "active"
618
+ "curriculum_pathway_id" : curriculum_pathway_id , "status" : "active"
619
619
}]
620
620
}
621
621
discipline_group .update ()
@@ -646,7 +646,7 @@ def test_update_association_status_negative_3(clean_firestore):
646
646
url = f"{ api_url } /{ association_group_uuid } /user-association/status"
647
647
request_body = {
648
648
"instructor" : {"instructor_id" : user_2 .user_id ,
649
- "curriculum_pathway_id" :curriculum_pathway_id ,
649
+ "curriculum_pathway_id" : curriculum_pathway_id ,
650
650
"status" : "active" }
651
651
}
652
652
@@ -683,7 +683,9 @@ def create_user_and_group(user_group_name, user_type):
683
683
user_dict .update ()
684
684
user_id2 = user_dict .user_id
685
685
686
- group_example = {"name" : user_group_name , "users" : [user_id1 , user_id2 ], "description" : "example group" }
686
+ group_example = {"name" : user_group_name ,
687
+ "users" : [user_id1 , user_id2 ],
688
+ "description" : "example group" }
687
689
688
690
group_dict = UserGroup .from_dict (group_example )
689
691
group_dict .uuid = ""
@@ -894,6 +896,7 @@ def create_learner_association_group(payload: dict,
894
896
Parameters
895
897
----------
896
898
payload: dict
899
+ program_id: str
897
900
898
901
Returns
899
902
-------
@@ -942,7 +945,7 @@ def test_add_instructor_positive_1(mocker, clean_firestore):
942
945
}]
943
946
discipline_assoc .associations = {
944
947
"curriculum_pathways" : [
945
- {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
948
+ {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
946
949
]
947
950
}
948
951
discipline_assoc .update ()
@@ -973,12 +976,12 @@ def test_add_instructor_positive_2(mocker, clean_firestore):
973
976
Add Instructor for various curriculum pathway
974
977
"""
975
978
# Create curriculum pathway
976
- pathway_id , pathway_id_1 , pathway_id_2 , program_id = \
977
- create_disciplines_and_programs ()
979
+ pathway_id , pathway_id_1 , pathway_id_2 , program_id = (
980
+ create_disciplines_and_programs ())
978
981
979
982
mocker .patch (
980
983
"routes.learner_association_group.get_all_discipline_for_given_program" ,
981
- return_value = [pathway_id ,pathway_id_1 , pathway_id_2 ])
984
+ return_value = [pathway_id , pathway_id_1 , pathway_id_2 ])
982
985
983
986
# Create User as type faculty
984
987
user = {** BASIC_USER_MODEL_EXAMPLE , "user_type" : "instructor" }
@@ -1000,7 +1003,7 @@ def test_add_instructor_positive_2(mocker, clean_firestore):
1000
1003
}]
1001
1004
discipline_assoc .associations = {
1002
1005
"curriculum_pathways" : [
1003
- {"curriculum_pathway_id" : pathway_id , "status" : "active" }
1006
+ {"curriculum_pathway_id" : pathway_id , "status" : "active" }
1004
1007
]
1005
1008
}
1006
1009
discipline_assoc .update ()
@@ -1041,8 +1044,8 @@ def test_add_instructor_positive_3(mocker, clean_firestore):
1041
1044
Add Instructor for existing removed instructor curriculum pathway
1042
1045
"""
1043
1046
# Create curriculum pathway
1044
- curriculum_pathway_id , _ , pathway_id_2 , program_id = \
1045
- create_disciplines_and_programs ()
1047
+ curriculum_pathway_id , _ , pathway_id_2 , program_id = (
1048
+ create_disciplines_and_programs ())
1046
1049
1047
1050
mocker .patch (
1048
1051
"routes.learner_association_group.get_all_discipline_for_given_program" ,
@@ -1068,7 +1071,7 @@ def test_add_instructor_positive_3(mocker, clean_firestore):
1068
1071
}]
1069
1072
discipline_assoc .associations = {
1070
1073
"curriculum_pathways" : [
1071
- {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
1074
+ {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
1072
1075
]
1073
1076
}
1074
1077
discipline_assoc .update ()
@@ -1215,8 +1218,8 @@ def test_add_instructor_negative_6(mocker, clean_firestore):
1215
1218
"""
1216
1219
1217
1220
# Create curriculum pathway
1218
- curriculum_pathway_id , _ , pathway_id_2 , program_id = \
1219
- create_disciplines_and_programs ()
1221
+ curriculum_pathway_id , _ , pathway_id_2 , program_id = (
1222
+ create_disciplines_and_programs ())
1220
1223
1221
1224
mocker .patch (
1222
1225
"routes.learner_association_group.get_all_discipline_for_given_program" ,
@@ -1242,7 +1245,7 @@ def test_add_instructor_negative_6(mocker, clean_firestore):
1242
1245
}]
1243
1246
discipline_assoc .associations = {
1244
1247
"curriculum_pathways" : [
1245
- {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
1248
+ {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
1246
1249
]
1247
1250
}
1248
1251
discipline_assoc .update ()
@@ -1270,8 +1273,8 @@ def test_remove_instructor_positive_1(mocker, clean_firestore):
1270
1273
Remove Instructor with correct payload
1271
1274
"""
1272
1275
# Create curriculum pathway
1273
- curriculum_pathway_id , _ , pathway_id_2 , program_id = \
1274
- create_disciplines_and_programs ()
1276
+ curriculum_pathway_id , _ , pathway_id_2 , program_id = (
1277
+ create_disciplines_and_programs ())
1275
1278
1276
1279
mocker .patch (
1277
1280
"routes.learner_association_group.get_all_discipline_for_given_program" ,
@@ -1297,7 +1300,7 @@ def test_remove_instructor_positive_1(mocker, clean_firestore):
1297
1300
}]
1298
1301
discipline_assoc .associations = {
1299
1302
"curriculum_pathways" : [
1300
- {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
1303
+ {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
1301
1304
]
1302
1305
}
1303
1306
discipline_assoc .update ()
@@ -1328,8 +1331,8 @@ def test_remove_instructor_positive_2(mocker, clean_firestore):
1328
1331
Remove Instructor from multiple instructors
1329
1332
"""
1330
1333
# Create curriculum pathway
1331
- pathway_id , pathway_id_1 , pathway_id_2 , program_id = \
1332
- create_disciplines_and_programs ()
1334
+ pathway_id , pathway_id_1 , pathway_id_2 , program_id = (
1335
+ create_disciplines_and_programs ())
1333
1336
1334
1337
mocker .patch (
1335
1338
"routes.learner_association_group.get_all_discipline_for_given_program" ,
@@ -1355,7 +1358,7 @@ def test_remove_instructor_positive_2(mocker, clean_firestore):
1355
1358
}]
1356
1359
discipline_assoc .associations = {
1357
1360
"curriculum_pathways" : [
1358
- {"curriculum_pathway_id" : pathway_id_1 , "status" : "active" }
1361
+ {"curriculum_pathway_id" : pathway_id_1 , "status" : "active" }
1359
1362
]
1360
1363
}
1361
1364
discipline_assoc .update ()
@@ -1522,7 +1525,7 @@ def test_remove_instructor_negative_6(mocker, clean_firestore):
1522
1525
}]
1523
1526
discipline_assoc .associations = {
1524
1527
"curriculum_pathways" : [
1525
- {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
1528
+ {"curriculum_pathway_id" : curriculum_pathway_id , "status" : "active" }
1526
1529
]
1527
1530
}
1528
1531
discipline_assoc .update ()
@@ -1589,8 +1592,8 @@ def test_remove_instructor_negative_8(mocker, clean_firestore):
1589
1592
"""
1590
1593
Remove instructor wrong curriculum pathway ID
1591
1594
"""
1592
- curriculum_pathway_id , pathway_id_1 , pathway_2 , program_id = \
1593
- create_disciplines_and_programs ()
1595
+ curriculum_pathway_id , pathway_id_1 , pathway_2 , program_id = (
1596
+ create_disciplines_and_programs ())
1594
1597
1595
1598
mocker .patch (
1596
1599
"routes.learner_association_group.get_all_discipline_for_given_program" ,
@@ -1687,8 +1690,8 @@ def test_get_all_the_learner_for_instructor(clean_firestore):
1687
1690
res_data = res .json ()
1688
1691
assert res .status_code == 200
1689
1692
assert res_data ["success" ] is True
1690
- assert res_data ["message" ] == "Successfully fetched the learners " \
1691
- "for the given instructor"
1693
+ assert ( res_data ["message" ] == "Successfully fetched the learners "
1694
+ "for the given instructor" )
1692
1695
assert user_1 .user_id in res_data ["data" ]
1693
1696
1694
1697
def test_get_all_the_learner_for_coach (clean_firestore ):
@@ -1730,8 +1733,8 @@ def test_get_all_the_learner_for_coach(clean_firestore):
1730
1733
res_data = res .json ()
1731
1734
assert res .status_code == 200
1732
1735
assert res_data ["success" ] is True
1733
- assert res_data ["message" ] == "Successfully fetched the learners " \
1734
- " for the given coach"
1736
+ assert ( res_data ["message" ] ==
1737
+ "Successfully fetched the learners for the given coach")
1735
1738
assert user_1 .user_id in res_data ["data" ]
1736
1739
1737
1740
def test_get_all_the_learner_for_coach_and_instructor_negative (clean_firestore ):
0 commit comments