TestFaculty2 - /usr/bin/env python import unittest import...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#!/usr/bin/env python import unittest import sys from Faculty2 import checkInDatastore, get_person, Person, PhoneNumber, Degree, Email, Website, Writing, Name, Schedule, Building, Location, Event, Class, Staff, StaffEvent, Award, Article, Conference, Publisher, Article, Student, Advisor from google.appengine.ext import db from xml.dom.minidom import parse class TestFaculty2 (unittest.TestCase) : """ sets up and parses the sample XML, which contains just Glenn Downing """ xml_tree = parse("TestFaculty2.xml") people = xml_tree.childNodes[0] #childNodes[0] = people node for person in people.childNodes : # faculty = people.childNodes, NOTE: newline characters are also included, faculty[1] = first faculty member if person.nodeName == "faculty": personRow = checkInDatastore(person) #get person in datastore to update if personRow == None: personRow = Person() #person was not in datastore create new get_person(person, personRow) """ Tests the Person class """ def test_person(self): for person in Person.all(): self.assert_(person.research_area == " Algorithms, Data structures, Generic and object-oriented programming in C++ and Java")
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

TestFaculty2 - /usr/bin/env python import unittest import...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online