class TestHandler(unittest.TestCase): def setUp(self): self.handler = URItoFileHandler(PATH_MAP) self.manifest_file = open_data_file('rdfcore/Manifest.rdf') def tearDown(self): self.manifest_file.close() def test_is_handler(self): self.assert_(isinstance(self.handler, BaseHandler)) def test_opening_unmapped_uri_raises_exception(self): self.assertRaises(URLError, self.handler.default_open, EX.test) def test_opening_mapped_uri_returns_file(self): manifest_file = self.handler.default_open(TESTS['Manifest.rdf']) self.assertEqual(manifest_file.read(), self.manifest_file.read())
def setUp(self): self.handler = URItoFileHandler(PATH_MAP) self.manifest_file = open_data_file('rdfcore/Manifest.rdf')