Skip to content

Commit

Permalink
fix UT in download (#149)
Browse files Browse the repository at this point in the history
Co-authored-by: Sikai Yao <yaosk@dp.tech>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 16, 2023
1 parent 068cea9 commit 8e03205
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/utils/test_dl_dpgen2_arti_by_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class MockedStep:
inputs = MockedDef()
outputs = MockedDef()

def __init__(self, key) -> None:
self.key = key

def __getitem__(
self,
kk,
Expand All @@ -58,9 +61,13 @@ class Mockedwf:

def query_step_by_key(self, key):
if key == sorted(self.keys):
return [MockedStep(), MockedStep(), MockedStep()]
return [
MockedStep(self.keys[0]),
MockedStep(self.keys[1]),
MockedStep(self.keys[2]),
]
else:
return [MockedStep() for kk in key]
return [MockedStep(kk) for kk in key]

def query_keys_of_steps(self):
return self.keys
Expand Down

0 comments on commit 8e03205

Please sign in to comment.