示例#1
0
    def test_error_string(self):
        f = self.f
        f.write("NName: foo")
        f.flush()
        try:
            PackageDescription.from_file(f.name)
            raise AssertionError("Should raise here !")
        except ParseError, e:
            self.assertEqual(str(e), """\
  File "%s", line 1
NName: foo
^
Syntax error""" % f.name)
示例#2
0
 def test_simple_filename(self):
     f = self.f
     f.write("NName: foo")
     f.flush()
     self.assertRaises(ParseError, lambda : PackageDescription.from_file(f.name))