Beispiel #1
0
def main(args=None):
    cfg_files = (
        # first look in current dir
        os.path.join(os.getcwd(), ".vamosrc"),
        # then in home dir
        os.path.expanduser("~/.vamosrc"),
    )
    tools = [PathTool()]
    return tools_main(tools, cfg_files, args)
Beispiel #2
0
def main():
    cfg_files = (
        # first look in current dir
        os.path.join(os.getcwd(), ".vamosrc"),
        # then in home dir
        os.path.expanduser("~/.vamosrc"),
    )
    tools = [PathTool()]
    sys.exit(tools_main(tools, cfg_files))
Beispiel #3
0
def main():
  cfg_files = (
      # first look in current dir
      os.path.join(os.getcwd(), ".vamosrc"),
      # then in home dir
      os.path.expanduser("~/.vamosrc"),
  )
  tools = [PathTool()]
  sys.exit(tools_main(tools, cfg_files))
Beispiel #4
0
def tools_path_simple_test(capsys, tmpdir):
    tools = [PathTool()]
    cwd = os.getcwd()
    cfg_dict = {
        "volumes": ["cwd:" + cwd],
        "path": {
            "vols_base_dir": str(tmpdir)
        }
    }
    res = tools_main(tools, args=["sys2ami", "tmp"], cfg_dict=cfg_dict)
    assert res == 0
    captured = capsys.readouterr()
    assert captured.out.splitlines() == ["cwd:tmp"]
Beispiel #5
0
def tools_path_simple_test(capsys, tmpdir):
  tools = [PathTool()]
  cwd = os.getcwd()
  cfg_dict = {
      "volumes": [
          "cwd:" + cwd
      ],
      "path": {
        "vols_base_dir" : str(tmpdir)
      }
  }
  res = tools_main(tools, args=['sys2ami', 'tmp'], cfg_dict=cfg_dict)
  assert res == 0
  captured = capsys.readouterr()
  assert captured.out.splitlines() == [
      "cwd:tmp"
  ]
Beispiel #6
0
def tools_main_multi_test():
    tools = [Tool("tool1"), Tool("tool2")]
    res = tools_main(tools, args=["tool1"])
    assert res == 0
Beispiel #7
0
def tools_main_single_test():
    tools = [Tool("tool")]
    res = tools_main(tools, args=[])
    assert res == 0
Beispiel #8
0
def tools_main_multi_test():
  tools = [Tool("tool1"), Tool("tool2")]
  res = tools_main(tools, args=["tool1"])
  assert res == 0
Beispiel #9
0
def tools_main_single_test():
  tools = [Tool("tool")]
  res = tools_main(tools, args=[])
  assert res == 0