can now put file extensions or names in files data

This commit is contained in:
Silen Naihin
2023-06-25 19:30:04 -04:00
parent adc6b225a6
commit 7604ae07bb
6 changed files with 57 additions and 18 deletions

View File

@@ -6,7 +6,7 @@
"answer": "Washington",
"should_contain": ["Washington"],
"should_not_contain": ["New York", "Los Angeles", "San Francisco"],
"files": ["file_to_check.txt"]
"files": [".txt"]
},
"mock_func": "basic_write_file_mock",
"info": {

View File

@@ -23,10 +23,12 @@ class TestWriteFile(BasicChallenge):
)
@pytest.mark.depends(name="test_write_file")
def test_write_file(self, workspace):
file = self.open_file(workspace, data.ground.files[0])
files_contents = self.open_files(workspace, data.ground.files)
score = self.scoring(file, data.ground)
scores = []
for file_content in files_contents:
score = self.scoring(file_content, data.ground)
print("Your score is:", score)
scores.append(score)
print("You score is:", score)
assert score
assert 1 in scores