def test_node_working_directory(tmpdir, node): directory = Config.instance().get_section_config("Server").get("projects_path") with patch("gns3server.compute.project.Project.is_local", return_value=True): p = Project(project_id=str(uuid4())) assert p.node_working_directory(node) == os.path.join(directory, p.id, 'project-files', node.module_name, node.id) assert os.path.exists(p.node_working_directory(node))
async def test_node_working_directory(node, projects_dir): directory = projects_dir with patch("gns3server.compute.project.Project.is_local", return_value=True): p = Project(project_id=str(uuid4())) assert p.node_working_directory(node) == os.path.join( directory, p.id, 'project-files', node.module_name, node.id) assert os.path.exists(p.node_working_directory(node))
def test_node_working_directory(tmpdir, node): directory = Config.instance().get_section_config("Server").get( "projects_path") with patch("gns3server.compute.project.Project.is_local", return_value=True): p = Project(project_id=str(uuid4())) assert p.node_working_directory(node) == os.path.join( directory, p.id, 'project-files', node.module_name, node.id) assert os.path.exists(p.node_working_directory(node))