-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DiningAPI encode/decode functions #26
Conversation
…est that all (current) terms and all subjects have a dict that return the correct term and subject. Nothing else can really be checked since the titles, instructors, course numbers, etc all vary.
…e DiningAPI's encode/decode functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..'AFRCNA'
'ANTH'
'ARABIC'
E.EE.........
======================================================================
ERROR: test_courseapi_get_courses (__main__.UnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "unit_tests.py", line 56, in test_courseapi_get_courses
except InvalidParameterException:
NameError: global name 'InvalidParameterException' is not defined
======================================================================
ERROR: test_courseapi_retrieve_from_url (__main__.UnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "unit_tests.py", line 65, in test_courseapi_retrieve_from_url
courses = CourseAPI._retrieve_from_url()
NameError: global name 'CourseAPI' is not defined
======================================================================
ERROR: test_diningapi_decode_dining_location (__main__.UnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "unit_tests.py", line 151, in test_diningapi_decode_dining_location
self.assertEqual(dining._decode_dining_location(u'bookstore_cafe'), u'Bookstore Caf\xe9')
File "/mnt/c/Users/Ritwik/Documents/GitHub/PittAPI/PittAPI/dining.py", line 145, in _decode_dining_location
string = unicode(str(string), u'utf-8')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 13: ordinal not in range(128)
----------------------------------------------------------------------
Ran 15 tests in 1.905s
FAILED (errors=3)
We changed the project to be in modules now, so there is no more |
Oh right forgot to fix that. |
…lem, and made meaningful fail messages for the CourseAPI tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there
..'AFRCNA'
'ANTH'
'ARABIC'
'ASL'
'ARCH'
F.F..........
======================================================================
FAIL: test_courseapi_get_courses (__main__.UnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "unit_tests.py", line 55, in test_courseapi_get_courses
self.assertEqual(res2, u'pass')
AssertionError: u'ARCH_2171_fail' != u'pass'
- ARCH_2171_fail
+ pass
======================================================================
FAIL: test_courseapi_retrieve_from_url (__main__.UnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "unit_tests.py", line 67, in test_courseapi_retrieve_from_url
self.assertEqual(res, u'pass')
AssertionError: u'empty course list: fail' != u'pass'
- empty course list: fail
+ pass
----------------------------------------------------------------------
Ran 15 tests in 3.121s
FAILED (failures=2)
We've actually progressed past this PR now |
Currently I have tests for half of the CourseAPI and half of the DiningAPI and a bunch of skeletal test functions.
Also what did we conclude regarding when no courses are offered?