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)
def test_simple_filename(self): f = self.f f.write("NName: foo") f.flush() self.assertRaises(ParseError, lambda : PackageDescription.from_file(f.name))