Skip to content

Commit e7d44c1

Browse files
committed
fix test
Signed-off-by: sirutBuasai <sirutbuasai27@outlook.com>
1 parent 125d3fa commit e7d44c1

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

test/docs/test_generate.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,33 @@ def test_validation(self, mock_paths, repo_a_dates, repo_b_dates, should_raise):
136136

137137
def mock_load(repo):
138138
if repo == "repo-a":
139-
return [ImageConfig(repo, version="1.0", ga=repo_a_dates[0], eop=repo_a_dates[1])]
139+
return [
140+
ImageConfig(
141+
repo,
142+
version="1.0",
143+
ga=repo_a_dates[0],
144+
eop=repo_a_dates[1],
145+
accelerator="gpu",
146+
platform="ec2",
147+
)
148+
]
140149
elif repo == "repo-b":
141-
return [ImageConfig(repo, version="1.0", ga=repo_b_dates[0], eop=repo_b_dates[1])]
150+
return [
151+
ImageConfig(
152+
repo,
153+
version="1.0",
154+
ga=repo_b_dates[0],
155+
eop=repo_b_dates[1],
156+
accelerator="gpu",
157+
platform="ec2",
158+
)
159+
]
142160
return []
143161

144162
with patch("generate.GLOBAL_CONFIG", patched_config):
145163
with patch("utils.GLOBAL_CONFIG", patched_config):
146164
with patch("image_config.GLOBAL_CONFIG", patched_config):
147-
with patch("generate.load_repository_images", mock_load):
165+
with patch("image_config.load_repository_images", mock_load):
148166
if should_raise:
149167
LOGGER.debug("Expecting ValueError for inconsistent dates")
150168
with pytest.raises(ValueError, match="Inconsistent dates"):

0 commit comments

Comments
 (0)