Exemplo n.º 1
0
def test_safe_glob_multi_glob(mock_glob):
    # Arrange
    mock_glob.return_value = ["glob_results.py", "more_results.py"]
    # Act
    match, result = safe_glob("*.py")

    # Assert
    assert match == True
    assert result == ["glob_results.py", "more_results.py"]
Exemplo n.º 2
0
def test_safe_glob_non_matching_glob(mock_glob):
    # Arrange
    mock_glob.return_value = []
    # Act
    match, result = safe_glob("*.py")

    # Assert
    assert match == False
    assert result == ["*.py"]
Exemplo n.º 3
0
def test_safe_glob_multi_glob(mock_glob):
    # Arrange
    mock_glob.return_value = ['glob_results.py', 'more_results.py']
    # Act
    match, result = safe_glob('*.py')

    # Assert
    assert match == True
    assert result == ['glob_results.py', 'more_results.py']