Open main menu

CDOT Wiki β

Changes

OPS435 Python3 Assignment 2P

1,439 bytes removed, 20:50, 7 November 2019
Tests and Test results
== Tests and Test results ==
You must name your class definition python script for Date as <code>a2_class_id]a2_class.py</code>. The following examples assumes that the student_id is rchan. This test script is for testing your class defination. The test script accepts two command line arguments, the first one is the date in "YYYY/MM/DD" format, and the second one is the number of day from the given date, a positive value indicates the number of days after the given date, and a negative value indicates the number of days before the given date. There is an optional flag called --step which causes the program can be used to print out all dates between the given date and test the target date. If the "YYYY/MM/DD" format is broken, the test script is responsible for handling the format error. Invalid months (>12) or invalid days of month(different for each month), should be detected in objects created by using your Date class code. For examples:* <b><code>python3 a1_rchan.py 2019/01/01 1</code></b>, and the output should be<br /> 2019/01/02* <b><code>python3 a1_rchan.py 2019/01/01 -1</code></b>, and the output should be<br /> 2018/12/31* <b><code>python3 a1_rchan.py 2019/01/01 2</code></b>, and the output should be<br /> 2019/01/03* <b><code>python3 a1_rchan.py --step 2019/01/01 3</code></b>, Please review that tests that failed and try to fix your class definition to address the output should be<br /> 2019/01/02 2019/01/03 2019/01/04* <b><code>python3 a1_rchanproblem.py 2018/07/01 500</code></b>, and the output should be<br /> 2019/11/13* <b><code>python3 a1_rchan.py 2018/99/01 2</code></b>, and the output should be<br /> Error: wrong month entered* <b><code>python3 a1_rchan.py 2018/01/99 2</code></b>, and the output should be<br /> Error: wrong day entered* <b><code>python3 a1_rchan.py 2018 2</code></b>, and the output should be<br /> Error: wrong date entered
If there is too few or too many command line arguments given, display the proper usage:
1,760
edits