@@ -94,7 +94,7 @@ def test_validate_action_flag_permissions(self):
9494
9595 # Case: Supplier has no permissions to perform any of the requested operations
9696 # Test case tuples are stuctured as (vaccine_type, vaccine_permissions, file_content)
97- test_cases = [
97+ invalid_cases = [
9898 # FLU, no permissions
9999 ("FLU" , ["FLU.U" , "COVID19.CRUDS" ], valid_content_new_and_delete_lowercase ),
100100 # COVID19, no permissions
@@ -103,11 +103,21 @@ def test_validate_action_flag_permissions(self):
103103 ("RSV" , ["FLU.C" , "FLU.U" ], valid_content_update_and_delete_lowercase ),
104104 ]
105105
106- for vaccine_type , vaccine_permissions , file_content in test_cases :
106+ for vaccine_type , vaccine_permissions , file_content in invalid_cases :
107107 with self .subTest ():
108108 with self .assertRaises (NoOperationPermissions ):
109109 validate_action_flag_permissions ("TEST_SUPPLIER" , vaccine_type , vaccine_permissions , file_content )
110110
111+ no_flag_cases = [
112+ ("FLU" , ["FLU.C" ], valid_file_content .replace ("new" , "" ).replace ("update" , "" )),
113+ ("COVID19" , ["COVID19.CRUD" ], valid_file_content .replace ("new" , "INVALID" ).replace ("update" , "" )),
114+ ]
115+
116+ for vaccine_type , permissions , file_content in no_flag_cases :
117+ with self .subTest (f"{ vaccine_type } with invalid or missing ACTION_FLAGs" ):
118+ result = validate_action_flag_permissions ("TEST_SUPPLIER" , vaccine_type , permissions , file_content )
119+ self .assertEqual (result , set ())
120+
111121
112122if __name__ == "__main__" :
113123 unittest .main ()
0 commit comments