Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

Rahi374
Copy link
Member

@Rahi374 Rahi374 commented Feb 10, 2017

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?

…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.
@Rahi374 Rahi374 mentioned this pull request Feb 10, 2017
@Rahi374 Rahi374 changed the title Unit tests (WIP) Fix DiningAPI encode/decode functions Feb 10, 2017
@RitwikGupta RitwikGupta self-requested a review February 10, 2017 05:47
Copy link
Member

@RitwikGupta RitwikGupta left a 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)

@RitwikGupta
Copy link
Member

We changed the project to be in modules now, so there is no more CourseAPI

@Rahi374
Copy link
Member Author

Rahi374 commented Feb 10, 2017

Oh right forgot to fix that.

…lem, and made meaningful fail messages for the CourseAPI tests
Copy link
Member

@RitwikGupta RitwikGupta left a 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)

@azharichenko
Copy link
Member

@Rahi374 In issue #22 I think the idea is when there are no courses offered it just returns an empty list.

@RitwikGupta
Copy link
Member

We've actually progressed past this PR now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants