1
0
forked from GitHub/gf-core

Checking args passed to gf functions.

This commit is contained in:
jordi.saludes
2010-07-22 14:19:55 +00:00
parent 3bb2995170
commit cebf1a1f6a
2 changed files with 21 additions and 6 deletions

View File

@@ -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()