From 63a4c97e18a6eda261e451098d2360a9570b89a7 Mon Sep 17 00:00:00 2001 From: "jordi.saludes" Date: Thu, 22 Jul 2010 14:19:55 +0000 Subject: Checking args passed to gf functions. --- contrib/py-bindings/test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'contrib/py-bindings/test.py') diff --git a/contrib/py-bindings/test.py b/contrib/py-bindings/test.py index 46164b126..716aba6c3 100644 --- a/contrib/py-bindings/test.py +++ b/contrib/py-bindings/test.py @@ -30,13 +30,17 @@ def rmprefix(obj): # return m and s[m.end(0):] class TestPgfInfo(unittest.TestCase): - def pgf(self): - return gf.read_pgf(self.path) + def pgf(self, path=None): + path = path or self.path + return gf.read_pgf(path) def setUp(self): self.path = 'Query.pgf' def test_readPgf(self): pgf = self.pgf() self.assertNotEqual(pgf,None) + def test_readNonExistent(self): + nopath = 'x' + self.path + self.assertRaises(IOError, self.pgf, nopath) def test_startcat(self): pgf = self.pgf() cat = pgf.startcat() -- cgit v1.2.3