Skip to content

Commit 9334ad4

Browse files
wangp-hclebergnu
authored andcommitted
fix 6068:Make the test class dependencies fulfill all the tests.
The 'type' field is removed from the dependencies_dict (using pop('type')), which causes the 'type' field to no longer exist in the dictionary during subsequent operations. The test updates are necessary because: 1. tests now get executed because of this fix 2. the JSON format needs to be escaped 3. the number of tests and expected passes is really 1 because the test path given specifies a single test. Signed-off-by: wangpeng <[email protected]> Signed-off-by: Cleber Rosa <[email protected]>
1 parent e7496db commit 9334ad4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

avocado/core/dependencies/dependency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __eq__(self, other):
5858
@classmethod
5959
def from_dictionary(cls, dictionary):
6060
return cls(
61-
dictionary.pop("type", None),
61+
dictionary.get("type", None),
6262
dictionary.pop("uri", None),
6363
dictionary.pop("args", ()),
6464
dictionary,

selftests/functional/serial/requirements.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ def test_c(self):
131131
"""
132132

133133
DEPENDENCY_RECIPE_FMT = """
134-
{
134+
{{
135135
"kind": "avocado-instrumented",
136136
"uri": "{path}",
137-
"kwargs": {"dependencies": [{"type": "package", "name": "hello"}]}
138-
}
137+
"kwargs": {{"dependencies": [{{"type": "package", "name": "hello"}}]}}
138+
}}
139139
"""
140140

141141

@@ -320,7 +320,7 @@ def test_dependency_recipe(self):
320320
result = process.run(command, ignore_status=True)
321321
self.assertEqual(result.exit_status, exit_codes.AVOCADO_ALL_OK)
322322
self.assertIn(
323-
"PASS 3",
323+
"PASS 1",
324324
result.stdout_text,
325325
)
326326
self.assertNotIn(

0 commit comments

Comments
 (0)