def test_sync_works(self):
try:
synced_file = os.path.join(self.workspace_root, "microDAQ", "exportLocation")
config = {
KEYS.USER: "riormt",
KEYS.P4_PORT: "penguin.natinst.com:1666",
KEYS.PERFORCE_PATH: "//microDAQ/exportLocation",
KEYS.CLIENT_WORKSPACE: self.workspace,
KEYS.FORCE: True
}
sync_perforce_path(config, self.status)
self.assertEqual(self.export_location_path, self.status.status["local_path"])
self.assertTrue(os.path.exists(synced_file))
self.assertTrue(self.status.status["succeeded"])
finally:
try:
os.chmod(self.export_location_path, stat.S_IWRITE)
shutil.rmtree(self.workspace_root)
except OSError:
self.fail("Directory was not synced from perforce...")
评论列表
文章目录