Esempio n. 1
0
 def test_parse_student(self):
     json_output = parse_student_csv.produce_json_doc(filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[0]["fname"], "Charles")
     self.assertEqual(json_output[0]["mname"], "anne")
     self.assertEqual(json_output[0]["lname"], "Fisher")
     self.assertEqual(json_output[0]["suffix"], "")
     self.assertEqual(json_output[4]["fname"], "Glen")
     self.assertEqual(json_output[4]["mname"], "Wilbur")
     self.assertEqual(json_output[4]["lname"], "Holland")
     self.assertEqual(json_output[4]["suffix"], "JR.")
Esempio n. 2
0
 def test_parse_student(self):
     json_output = parse_student_csv.produce_json_doc(filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[0]["fname"], "John")
     self.assertEqual(json_output[0]["mname"], "bob")
     self.assertEqual(json_output[0]["lname"], "Doe1")
     self.assertEqual(json_output[0]["suffix"], "")
     self.assertEqual(json_output[4]["fname"], "John4")
     self.assertEqual(json_output[4]["mname"], "harry")
     self.assertEqual(json_output[4]["lname"], "Doe5")
     self.assertEqual(json_output[4]["suffix"], "JR.")
Esempio n. 3
0
 def test_parse_student(self):
     json_output = parse_student_csv.produce_json_doc(
         filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[0]["fname"], "John")
     self.assertEqual(json_output[0]["mname"], "bob")
     self.assertEqual(json_output[0]["lname"], "Doe1")
     self.assertEqual(json_output[0]["suffix"], "")
     self.assertEqual(json_output[4]["fname"], "John4")
     self.assertEqual(json_output[4]["mname"], "harry")
     self.assertEqual(json_output[4]["lname"], "Doe5")
     self.assertEqual(json_output[4]["suffix"], "JR.")
Esempio n. 4
0
 def test_parse_student(self):
     json_output = parse_student_csv.produce_json_doc(
         filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[0]["fname"], "Charles")
     self.assertEqual(json_output[0]["mname"], "anne")
     self.assertEqual(json_output[0]["lname"], "Fisher")
     self.assertEqual(json_output[0]["suffix"], "")
     self.assertEqual(json_output[4]["fname"], "Glen")
     self.assertEqual(json_output[4]["mname"], "Wilbur")
     self.assertEqual(json_output[4]["lname"], "Holland")
     self.assertEqual(json_output[4]["suffix"], "JR.")
Esempio n. 5
0
 def test_address(self):
     json_output = parse_student_csv.produce_json_doc(filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["address"], "794 John Doe Ave.")
     self.assertEqual(json_output[3]["city"], "Stuart")
     self.assertEqual(json_output[3]["state"], "VA")
     self.assertEqual(json_output[3]["zip"], "24171")
     self.assertEqual(json_output[3]["nation"], "usa")
     self.assertEqual(json_output[3]["location"]["lat"], 36.655575)
     self.assertEqual(json_output[3]["location"]["lon"], -80.23909)
     self.assertEqual(json_output[4]["address"], "1008 John Doe Ln Apt. # 801")
     self.assertEqual(json_output[4]["city"], "Bowling G")
     self.assertEqual(json_output[4]["state"], "OH")
     self.assertEqual(json_output[4]["zip"], "43402")
     self.assertEqual(json_output[4]["nation"], "United St")
     self.assertEqual(json_output[4]["location"]["lat"], 41.388519)
     self.assertEqual(json_output[4]["location"]["lon"], -83.65795)
Esempio n. 6
0
 def test_address(self):
     json_output = parse_student_csv.produce_json_doc(
         filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["address"], "794 John Doe Ave.")
     self.assertEqual(json_output[3]["city"], "Stuart")
     self.assertEqual(json_output[3]["state"], "VA")
     self.assertEqual(json_output[3]["zip"], "24171")
     self.assertEqual(json_output[3]["nation"], "usa")
     self.assertEqual(json_output[3]["location"]["lat"], 36.655575)
     self.assertEqual(json_output[3]["location"]["lon"], -80.23909)
     self.assertEqual(json_output[4]["address"],
                      "1008 John Doe Ln Apt. # 801")
     self.assertEqual(json_output[4]["city"], "Bowling G")
     self.assertEqual(json_output[4]["state"], "OH")
     self.assertEqual(json_output[4]["zip"], "43402")
     self.assertEqual(json_output[4]["nation"], "United St")
     self.assertEqual(json_output[4]["location"]["lat"], 41.388519)
     self.assertEqual(json_output[4]["location"]["lon"], -83.65795)
Esempio n. 7
0
 def test_timestamp(self):
     json_output = parse_student_csv.produce_json_doc(filename="samples/2014-02-05.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["timestamp"], "2014-02-05T12:00:00")
Esempio n. 8
0
 def test_online(self):
     json_output = parse_student_csv.produce_json_doc(filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["online"], "No")
     self.assertEqual(json_output[4]["online"], "Yes")
Esempio n. 9
0
 def test_email(self):
     json_output = parse_student_csv.produce_json_doc(filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["email"], "doe4@")
     self.assertEqual(json_output[4]["email"], "doe5@")
Esempio n. 10
0
 def test_otherinfo(self):
     json_output = parse_student_csv.produce_json_doc(filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["otherinfo"], "12345")
     self.assertEqual(json_output[4]["otherinfo"], "abcdefg")
Esempio n. 11
0
 def test_parse_grader(self):
     json_output = parse_student_csv.produce_json_doc(filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[0]["Grader"], "sb")
     self.assertEqual(json_output[3]["Grader"], "dab")
Esempio n. 12
0
 def test_timestamp(self):
     json_output = parse_student_csv.produce_json_doc(
         filename="samples/2014-02-05.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["timestamp"], "2014-02-05T12:00:00")
Esempio n. 13
0
 def test_online(self):
     json_output = parse_student_csv.produce_json_doc(
         filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["online"], "No")
     self.assertEqual(json_output[4]["online"], "Yes")
Esempio n. 14
0
 def test_email(self):
     json_output = parse_student_csv.produce_json_doc(
         filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["email"], "doe4@")
     self.assertEqual(json_output[4]["email"], "doe5@")
Esempio n. 15
0
 def test_otherinfo(self):
     json_output = parse_student_csv.produce_json_doc(
         filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[3]["otherinfo"], "12345")
     self.assertEqual(json_output[4]["otherinfo"], "abcdefg")
Esempio n. 16
0
 def test_parse_grader(self):
     json_output = parse_student_csv.produce_json_doc(
         filename="samples/newstudent.csv", zipmap=self.zipMap)
     self.assertEqual(len(json_output), 5)
     self.assertEqual(json_output[0]["Grader"], "sb")
     self.assertEqual(json_output[3]["Grader"], "dab")