@pytest.mark.parametrize('test_path, expected', [('mock://top_level/second_level/date=2019-10-01/a.parquet', ['top_level/second_level/date=2019-10-01/a.parquet']), ('mock://top_level/second_level/date=2019-10-01/*', ['top_level/second_level/date=2019-10-01/a.parquet', 'top_level/second_level/date=2019-10-01/b.parquet']), ('mock://top_level/second_level/date=2019-10', []), ('mock://top_level/second_level/date=2019-10-0[1-4]', ['top_level/second_level/date=2019-10-01', 'top_level/second_level/date=2019-10-02', 'top_level/second_level/date=2019-10-04']), ('mock://top_level/second_level/date=2019-10-0[1-4]/*', ['top_level/second_level/date=2019-10-01/a.parquet', 'top_level/second_level/date=2019-10-01/b.parquet', 'top_level/second_level/date=2019-10-02/a.parquet', 'top_level/second_level/date=2019-10-04/a.parquet']), ('mock://top_level/second_level/date=2019-10-0[1-4]/[a].*', ['top_level/second_level/date=2019-10-01/a.parquet', 'top_level/second_level/date=2019-10-02/a.parquet', 'top_level/second_level/date=2019-10-04/a.parquet']), ('mock://glob_test/hat/^foo.*', ['glob_test/hat/^foo.txt']), ('mock://glob_test/dollar/$foo.*', ['glob_test/dollar/$foo.txt']), ('mock://glob_test/lbrace/{foo.*', ['glob_test/lbrace/{foo.txt']), ('mock://glob_test/rbrace/}foo.*', ['glob_test/rbrace/}foo.txt'])])
def test_glob(test_path, expected):
    test_fs = DummyTestFS()
    res = test_fs.glob(test_path)
    res = sorted(res)
    assert (res == expected)
    res = test_fs.glob(test_path, detail=True)
    assert isinstance(res, dict)
    assert (sorted(res) == expected)
    for (name, info) in res.items():
        assert (info == test_fs[name])
@pytest.mark.parametrize('test_path, expected', [('mock://top_level/second_level/date=2019-10-01/a.parquet', ['top_level/second_level/date=2019-10-01/a.parquet']), ('mock://top_level/second_level/date=2019-10-01/*', ['top_level/second_level/date=2019-10-01/a.parquet', 'top_level/second_level/date=2019-10-01/b.parquet']), ('mock://top_level/second_level/date=2019-10', []), ('mock://top_level/second_level/date=2019-10-0[1-4]', ['top_level/second_level/date=2019-10-01', 'top_level/second_level/date=2019-10-02', 'top_level/second_level/date=2019-10-04']), ('mock://top_level/second_level/date=2019-10-0[1-4]/*', ['top_level/second_level/date=2019-10-01/a.parquet', 'top_level/second_level/date=2019-10-01/b.parquet', 'top_level/second_level/date=2019-10-02/a.parquet', 'top_level/second_level/date=2019-10-04/a.parquet']), ('mock://top_level/second_level/date=2019-10-0[1-4]/[a].*', ['top_level/second_level/date=2019-10-01/a.parquet', 'top_level/second_level/date=2019-10-02/a.parquet', 'top_level/second_level/date=2019-10-04/a.parquet']), ('mock://glob_test/hat/^foo.*', ['glob_test/hat/^foo.txt']), ('mock://glob_test/dollar/$foo.*', ['glob_test/dollar/$foo.txt']), ('mock://glob_test/lbrace/{foo.*', ['glob_test/lbrace/{foo.txt']), ('mock://glob_test/rbrace/}foo.*', ['glob_test/rbrace/}foo.txt'])])
def test_glob(test_path, expected):
    test_fs = DummyTestFS()
    res = test_fs.glob(test_path)
    res = sorted(res)
    assert (res == expected)
    res = test_fs.glob(test_path, detail=True)
    assert isinstance(res, dict)
    assert (sorted(res) == expected)
    for (name, info) in res.items():
        assert (info == test_fs[name])