def test_path(self): root = resource_filename('nive.utils.dataPool2', 'tests/') file = File("aaa") file.fromPath(root + "test_db.py") self.assert_(file.filename == "test_db.py") self.assert_(file.extension == "py") self.assertFalse(file.abspath()) file = File(filekey="aaa", file=None) file.fileentry = fileentrytest file.path = root + "test_db.py" self.assert_(file.abspath().startswith(root)) file = File("aaa", filename="qqqq.png", size=10) file.fromPath(root + "test_db.py") self.assert_(file.filename == "qqqq.png") self.assert_(file.extension == "png")
def test_path(self): root = resource_filename('nive.utils.dataPool2', 'tests/') file = File("aaa") file.fromPath(root+"test_db.py") self.assert_(file.filename=="test_db.py") self.assert_(file.extension=="py") self.assertFalse(file.abspath()) file = File(filekey="aaa", file=None ) file.fileentry=fileentrytest file.path = root+"test_db.py" self.assert_(file.abspath().startswith(root)) file = File("aaa", filename="qqqq.png", size=10) file.fromPath(root+"test_db.py") self.assert_(file.filename=="qqqq.png") self.assert_(file.extension=="png")