view tests/pathutil.py @ 385:2d5f2289885a

tests: Add support for "Chef tests", which are direct CLI tests. Since Chef tests are written as YAML tests and also involve creating a mock file-system, this change includes a refactor of the bake tests to put some functionality in a common base class.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 11 May 2015 22:25:19 -0700
parents a2d283d1033d
children
line wrap: on
line source

import os


def slashfix(path):
    if path is None:
        return None
    if isinstance(path, str):
        return path.replace('/', os.sep)
    fixed = []
    for p in path:
        fixed.append(p.replace('/', os.sep))
    return fixed