Python 3.2.3rc2 (default, Mar 21 2012, 06:59:51) [GCC 4.6.3] on linux2 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> .. ---------------------------------------------------------------------- Ran 2 tests in 0.065s OK >>> ================================ RESTART ================================ >>> E.. ====================================================================== ERROR: test_gpa (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 37, in test_gpa self.assertEqual(student.gpa(guybrush), 4.0) AttributeError: 'module' object has no attribute 'gpa' ---------------------------------------------------------------------- Ran 3 tests in 0.050s FAILED (errors=1) >>> ================================ RESTART ================================ >>> F.. ====================================================================== FAIL: test_gpa (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 37, in test_gpa self.assertEqual(student.gpa(guybrush), 4.0) AssertionError: None != 4.0 ---------------------------------------------------------------------- Ran 3 tests in 0.106s FAILED (failures=1) >>> ================================ RESTART ================================ >>> E.. ====================================================================== ERROR: test_gpa (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 37, in test_gpa self.assertEqual(student.gpa(guybrush), 4.0) File "/home/sukaeto/test1/student.py", line 23, in gpa total_qp += course.quality_points(course) AttributeError: 'dict' object has no attribute 'quality_points' ---------------------------------------------------------------------- Ran 3 tests in 0.040s FAILED (errors=1) >>> [DEBUG ON] >>> [DEBUG OFF] >>> ================================ RESTART ================================ >>> ... ---------------------------------------------------------------------- Ran 3 tests in 0.039s OK >>> ================================ RESTART ================================ >>> E... ====================================================================== ERROR: test_add_course (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 62, in test_add_course student.add_course(guybrush, new_course) AttributeError: 'module' object has no attribute 'add_course' ---------------------------------------------------------------------- Ran 4 tests in 0.065s FAILED (errors=1) >>> ================================ RESTART ================================ >>> E... ====================================================================== ERROR: test_add_course (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 62, in test_add_course student.add_course(guybrush, new_course) TypeError: add_course() takes exactly 1 positional argument (2 given) ---------------------------------------------------------------------- Ran 4 tests in 0.055s FAILED (errors=1) >>> ================================ RESTART ================================ >>> F... ====================================================================== FAIL: test_add_course (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 64, in test_add_course self.assertEqual(guybrush['courses'], courses2) AssertionError: Lists differ: [{'grade': 'A', 'credits': 1.0... != [{'grade': 'A', 'credits': 1.0... Second list contains 1 additional elements. First extra element 2: {'grade': 'C', 'credits': 3.0, 'term': '12S', 'name': 'Ghost/Zombie Piracy', 'number': 'PIR234'} [{'credits': 1.0, 'grade': 'A', 'name': 'Underwater basket weaving', 'number': 'ART234', 'term': '12S'}, {'credits': 3.0, 'grade': 'A', 'name': 'Computer Science for Engineers', 'number': 'CISC106', - 'term': '11F'}] ? ^ + 'term': '11F'}, ? ^ + {'credits': 3.0, + 'grade': 'C', + 'name': 'Ghost/Zombie Piracy', + 'number': 'PIR234', + 'term': '12S'}] ---------------------------------------------------------------------- Ran 4 tests in 0.129s FAILED (failures=1) >>> ================================ RESTART ================================ >>> .... ---------------------------------------------------------------------- Ran 4 tests in 0.056s OK >>> import json >>> json.loads('[0, 1, {"stuff" : false, "things" 45.98}]') Traceback (most recent call last): File "", line 1, in json.loads('[0, 1, {"stuff" : false, "things" 45.98}]') File "/usr/lib/python3.2/json/__init__.py", line 309, in loads return _default_decoder.decode(s) File "/usr/lib/python3.2/json/decoder.py", line 351, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.2/json/decoder.py", line 367, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Expecting : delimiter: line 1 column 34 (char 34) >>> json.loads('[0, 1, {"stuff" : false, "things" : 45.98}]') [0, 1, {'things': 45.98, 'stuff': False}] >>> data = json.loads('[0, 1, {"stuff" : false, "things" : 45.98}]') >>> data [0, 1, {'things': 45.98, 'stuff': False}] >>> data[0] 0 >>> data[2] {'things': 45.98, 'stuff': False} >>> data[2]['stuff'] False >>> json.dumps(data) '[0, 1, {"things": 45.98, "stuff": false}]' >>> json_string = json.dumps(data) >>> json_string[0] '[' >>> json_string[2] ',' >>> json_string[2]['stuff'] Traceback (most recent call last): File "", line 1, in json_string[2]['stuff'] TypeError: string indices must be integers >>> ================================ RESTART ================================ >>> .E... ====================================================================== ERROR: test_distance_between (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 72, in test_distance_between self.assertEqual(point.distance_between(p1, p2), math.sqrt(2)) AttributeError: 'module' object has no attribute 'distance_between' ---------------------------------------------------------------------- Ran 5 tests in 0.066s FAILED (errors=1) >>> ================================ RESTART ================================ >>> .E... ====================================================================== ERROR: test_distance_between (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 72, in test_distance_between self.assertEqual(point.distance_between(p1, p2), math.sqrt(2)) File "/home/sukaeto/test1/point.py", line 7, in distance_between return math.sqrt((point1['x'] - point2['x'])**2 + (point2['y'] - point['y'])**2) NameError: global name 'point' is not defined ---------------------------------------------------------------------- Ran 5 tests in 0.065s FAILED (errors=1) >>> ================================ RESTART ================================ >>> ..... ---------------------------------------------------------------------- Ran 5 tests in 0.071s OK >>> ================================ RESTART ================================ >>> ....E. ====================================================================== ERROR: test_talk (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 75, in test_talk cat1 = cat.create('Cat', 4) NameError: global name 'cat' is not defined ---------------------------------------------------------------------- Ran 6 tests in 0.077s FAILED (errors=1) >>> ================================ RESTART ================================ >>> ....E. ====================================================================== ERROR: test_talk (__main__.TestAugust6) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/august6_tests.py", line 79, in test_talk self.assertEqual(cat.talk(cat1), 'Cat the 4 legged cat says meow!') AttributeError: 'module' object has no attribute 'talk' ---------------------------------------------------------------------- Ran 6 tests in 0.074s FAILED (errors=1) >>> ================================ RESTART ================================ >>> ...... ---------------------------------------------------------------------- Ran 6 tests in 0.072s OK >>>