You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me know of any other improvements I can make. 👍
Marvins-MBP:maths marvinmichum$ python3 zellers_congruence.py --help
usage: zellers_congruence.py [-h] date_input
Find out what day of the week nearly any date is or was. Enter date as a
string in the mm-dd-yyyy or mm/dd/yyyy format
positional arguments:
date_input Date as a string (mm-dd-yyyy or mm/dd/yyyy)
optional arguments:
-h, --help show this help message and exit
Marvins-MBP:maths marvinmichum$ python3 zellers_congruence.py -v
Trying:
zeller('01-31-2010')
Expecting:
Your date 01-31-2010, is a Sunday!
ok
Trying:
zeller('13-31-2010')
Expecting:
Traceback (most recent call last):
...
ValueError: Month must be between 1 - 12
ok
Trying:
zeller('.2-31-2010')
Expecting:
Traceback (most recent call last):
...
ValueError: invalid literal forint() with base 10: '.2'
ok
Trying:
zeller('01-33-2010')
Expecting:
Traceback (most recent call last):
...
ValueError: Date must be between 1 - 31
ok
Trying:
zeller('01-.4-2010')
Expecting:
Traceback (most recent call last):
...
ValueError: invalid literal forint() with base 10: '.4'
ok
Trying:
zeller('01-31*2010')
Expecting:
Traceback (most recent call last):
...
ValueError: Date seperator must be '-' or '/'
ok
Trying:
zeller('01^31-2010')
Expecting:
Traceback (most recent call last):
...
ValueError: Date seperator must be '-' or '/'
ok
Trying:
zeller('01-31-8999')
Expecting:
Traceback (most recent call last):
...
ValueError: Year out of range. There has to be some sort of limit...right?
ok
Trying:
zeller()
Expecting:
Traceback (most recent call last):
...
TypeError: zeller() missing 1 required positional argument: 'date_input'
ok
Trying:
zeller('')
Expecting:
Traceback (most recent call last):
...
ValueError: Must be 10 characters long
ok
Trying:
zeller('01-31-19082939')
Expecting:
Traceback (most recent call last):
...
ValueError: Must be 10 characters long
ok
1 items had no tests:
__main__
1 items passed all tests:
11 tests in __main__.zeller
11 tests in 2 items.
11 passed and 0 failed.
Test passed.
The reason will be displayed to describe this comment to others. Learn more.
This is a great piece of work. I approve it in its current state.
Please consider adding one or more tests to compare zeller()'s results against the Python standard library results:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let me know of any other improvements I can make. 👍