def test_rcc_cloud(rcc: IRcc, ci_credentials: str, tmpdir: py.path.local): assert not rcc.credentials_valid() result = rcc.add_credentials(ci_credentials) assert result.success assert rcc.credentials_valid() result = rcc.cloud_list_workspaces() assert result.success workspaces = result.result if not workspaces: raise AssertionError("Expected to have CI Workspace available.") workspaces = [ ws for ws in workspaces if ws.workspace_name == "CI workspace" ] if not workspaces: raise AssertionError("Expected to have CI Workspace available.") ws = workspaces[0] result = rcc.cloud_list_workspace_robots(ws.workspace_id) assert result.success lst = result.result if lst is None: raise AssertionError("Found no workspace") acts = [act for act in lst if act.robot_name == "CI activity"] if not acts: result = rcc.cloud_create_robot(ws.workspace_id, "CI activity") assert result.success result = rcc.cloud_list_workspace_robots(ws.workspace_id) assert result.success lst = result.result if lst is None: raise AssertionError("Found no activity") acts = [act for act in lst if act.robot_name == "CI activity"] if not acts: raise AssertionError( "Expected to be able to create CI activity (or have it there already)." ) act: IRccRobotMetadata = acts[0] wsdir = str(tmpdir.join("ws")) result = rcc.create_robot("minimal", wsdir) assert result.success result = rcc.cloud_set_robot_contents(wsdir, ws.workspace_id, act.robot_id) assert result.success
def test_rcc_run_with_conda_yaml(rcc: IRcc, rcc_conda_installed): python_code = """ import sys sys.stdout.write('It worked') """ conda_yaml_str_contents = """ channels: - defaults - conda-forge dependencies: - python=3.7.5 """ result = rcc.run_python_code_robot_yaml(python_code, conda_yaml_str_contents) assert result.success assert result.result # Note: even in silent mode we may have additional output! assert "It worked" in result.result
def rcc_conda_installed(rcc: IRcc): result = rcc.check_conda_installed() assert result.success, r"Error: {result}"
def test_rcc_template_names(rcc: IRcc): result = rcc.get_template_names() assert result.success assert result.result assert "minimal" in result.result
def test_rcc_template_names(rcc: IRcc): result = rcc.get_template_names() assert result.success assert result.result assert "Standard - Robot Framework Robot." in result.result