Added requirements.txt for peewee and included in install steps, refactored to use argparse, fixed some capitalisation and spelling, fixed test for SKY, and tested that it works with Python 3.8.
I understand argparse changes the syntax of the script slightly, as you have to add -n/--number [NUMBER] --type ['cars','goods'] to get all the options, but I think it's clearer now.
Oh and you couldn't press any key, as Input expects a Return/Enter, so changed it to "press Return".
Cheers,
Iman
PS: after the test the pycache folder is left behind which you have to remove if you want to run another test or it is included and it fails. If you change to .py it won't try to include subfolders and the problem is avoided, so changed the README.md file to reflect that.
(roadtax) iman@roadtaxTracker$python -m unittest test/*
.....
----------------------------------------------------------------------
Ran 5 tests in 0.006s
OK
(roadtax) iman@roadtaxTracker$python -m unittest test/*
E.....
======================================================================
ERROR: test/__pycache__ (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test/__pycache__
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
ModuleNotFoundError: No module named 'test/__pycache__'
----------------------------------------------------------------------
Ran 6 tests in 0.006s
FAILED (errors=1)
(roadtax) iman@roadtaxTracker$rm -rf test/__pycache__/
(roadtax) iman@roadtaxTracker$python -m unittest test/*
.....
----------------------------------------------------------------------
Ran 5 tests in 0.006s
OK
(roadtax) iman@roadtaxTracker$python -m unittest test/*.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.006s
OK
Added requirements.txt for peewee and included in install steps, refactored to use argparse, fixed some capitalisation and spelling, fixed test for SKY, and tested that it works with Python 3.8.
I understand argparse changes the syntax of the script slightly, as you have to add -n/--number [NUMBER] --type ['cars','goods'] to get all the options, but I think it's clearer now.
Oh and you couldn't press any key, as Input expects a Return/Enter, so changed it to "press Return".
Cheers, Iman
PS: after the test the pycache folder is left behind which you have to remove if you want to run another test or it is included and it fails. If you change to .py it won't try to include subfolders and the problem is avoided, so changed the README.md file to reflect that.