Beispiel #1
0
 def __call__(self, parser, namespace, values, option_string=None):
     setattr(namespace, self.dest, to_sanitized_path(values))
def test_sanitize_should_not_change_absolute_path():
    """
        Test sanitize should not change absolute path
    """
    absolute_path = '/absolut/path/toto.py'
    assert to_sanitized_path(absolute_path) == absolute_path
def test_sanitize_should_not_change_path_starting_with_dot_slash():
    """
        Test sanitize should not change path starting with dot slash
    """
    path = './toto.py'
    assert to_sanitized_path(path) == path
def test_should_sanitize_path():
    """
        Test should add ./ to path if does not start wiht / or ./
    """
    assert to_sanitized_path('toto.py') == './toto.py'