Skip to content

CS50p week 6 CS50 P-Shirt check 50 testcase of non-existent file is not good #196

Open
@thaitri2005

Description

@thaitri2005

The testcase is supposed to test whether the program student write can exit if given a non-existent file. However, this specific testcase gave only one command-line argument, which violates another test (the program has to exit when given anything less or more than two command-line arguments.

image

As is a common practice to test the number of command-line arguments before testing whether the file exists, this check50 testcase may fails its purpose of testing whether the program can catch an invalid file. Student might not write the except FileNotFoundError and still pass the check50

Suggestion: change the testcase into one that gives two command-line arguments.
For example: python shirt.py non_existent_image.jpg after1.jpg

Metadata

Metadata

Labels

CS50PCS50 Python

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions