예제 #1
0
  def testGetSchoolsFromNonEmptyReader(self):
    """Tests that schools are correctly returned for valid input."""
    reader = StringIO.StringIO(TEST_INPUT_READER_DATA)
    schools = school_logic.getSchoolsFromReader(reader)

    self.assertEqual(len(schools), TEST_INPUT_SIZE)
    for i in range(TEST_INPUT_SIZE):
      self.assertEqual(schools[i].uid, 'uid%s' % i)
      self.assertEqual(schools[i].name, 'name%s' % i)
      self.assertEqual(schools[i].country, 'country%s' % i)
예제 #2
0
 def testGetSchoolsFromEmptyReader(self):
   """Tests that no schools are returned for empty input reader."""
   reader = StringIO.StringIO()
   schools = school_logic.getSchoolsFromReader(reader)
   self.assertListEqual(schools, [])