Add 'Debug simple typo with guidance' challenge (#65)

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
merwanehamadi
2023-07-07 13:50:53 -07:00
committed by GitHub
parent bfd0d5c826
commit 9ede17891b
56 changed files with 288 additions and 85 deletions

View File

@@ -0,0 +1 @@
random string Hello World!

View File

@@ -4,9 +4,10 @@
"task": "Write the string 'random string' before any existing text to the file called file_to_check.txt",
"dependencies": ["basic_write_file"],
"ground": {
"answer": "random string: Hello World!",
"should_contain": ["random string: Hello World!"],
"files": ["file_to_check.txt"]
"answer": "random string Hello World!",
"should_contain": ["random string", "Hello World!"],
"files": ["file_to_check.txt"],
"type": "file"
},
"mock": {
"mock_func": "basic_read_file_mock"

View File

@@ -15,7 +15,9 @@ class TestReadFile(BasicChallenge):
@pytest.mark.depends(on=["basic_write_file"], name="basic_read_file")
def test_method(self, config: Dict[str, Any]) -> None:
self.setup_challenge(config)
files_contents = self.open_files(config["workspace"], self.data.ground.files)
files_contents = self.get_artifacts_out(
config["workspace"], self.data.ground.files
)
scores = []
for file_content in files_contents:

View File

@@ -7,7 +7,8 @@
"answer": "Washington",
"should_contain": ["Washington"],
"should_not_contain": ["New York", "Los Angeles", "San Francisco"],
"files": [".txt"]
"files": [".txt"],
"type": "file"
},
"mock": {
"mock_func": "basic_write_file_mock",

View File

@@ -16,7 +16,9 @@ class TestWriteFile(BasicChallenge):
def test_method(self, config: Dict[str, Any]) -> None:
self.setup_challenge(config)
files_contents = self.open_files(config["workspace"], self.data.ground.files)
files_contents = self.get_artifacts_out(
config["workspace"], self.data.ground.files
)
scores = []
for file_content in files_contents: