You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
721 B

import os
from lint import workflow_files
def test_workflow_files():
assert workflow_files("") == []
assert workflow_files("not-a-real-file.yml") == []
assert workflow_files("test.yml") == ["test.yml"]
# multiple files
assert workflow_files("test.yml test-alt.yml") == sorted(
["test.yml", "test-alt.yml"]
)
# directory
assert workflow_files("../tests") == sorted(set(
["../tests/"+file for file in os.listdir("../tests") if file.endswith((".yml", ".yaml"))]
))
# directory and files
assert workflow_files("test.yml ../tests") == sorted(set(
["test.yml"] + ["../tests/"+file for file in os.listdir("./") if file.endswith((".yml", ".yaml"))]
))