Skip to content

Commit 31d2de0

Browse files
authored
Merge pull request #1114 from ryoya-hayase/feature/W2025-28
fix test shells
2 parents cdb8810 + 763ff9b commit 31d2de0

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

test/tavern/helper/item_type_mapping/verify_helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ def prepare_data(dic, result_flg=False):
352352
result_dict[f"@{attr_key}"] = attr_value
353353
elif isinstance(v, dict):
354354
result_dict[k.split(':')[-1]] = prepare_data(v, result_flg)
355+
else:
356+
result_dict[k.split(':')[-1]] = v
355357

356358
if '#text' in result_dict and len(result_dict) == 1:
357359
return result_dict['#text']

test/tavern/test/index/index_test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ if [ "$option_cmd" = "select" ]; then
7676
role_result="$role_result or $line"
7777
fi
7878
done
79-
if [ -z "$target_result" ] || [ -z "$role_result" ]; then
79+
if [ -z "$target_result" ] && [ -z "$role_result" ]; then
8080
echo "エラー: 対象テストまたは役割テストの指定が不十分です。"
8181
exit 1
8282
fi
8383
if [ -n "$target_result" ] && [ -n "$role_result" ]; then
8484
pytest_opts="$pytest_opts -m '($target_result) and ($role_result)'"
8585
elif [ -n "$target_result" ]; then
86-
pytest_opts="$pytest_opts -m ('$target_result')"
86+
pytest_opts="$pytest_opts -m \"$target_result\""
8787
elif [ -n "$role_result" ]; then
88-
pytest_opts="$pytest_opts -m ('$role_result')"
88+
pytest_opts="$pytest_opts -m \"$role_result\""
8989
fi
9090
fi
9191

test/tavern/test/item_create/item_create_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [ "$option_cmd" = "select" ]; then
3131
fi
3232
done
3333
if [ -n "$target_result" ]; then
34-
pytest_opts="$pytest_opts -m ('$target_result')"
34+
pytest_opts="$pytest_opts -m \"$target_result\""
3535
fi
3636
fi
3737

test/tavern/test/item_type_mapping/item_type_mapping_test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ if [ "$option_cmd" = "select" ]; then
5959
role_result="$role_result or $line"
6060
fi
6161
done
62-
if [ -z "$target_result" ] || [ -z "$role_result" ]; then
62+
if [ -z "$target_result" ] && [ -z "$role_result" ]; then
6363
echo "エラー: 対象テストまたは役割テストの指定が不十分です。"
6464
exit 1
6565
fi
6666
if [ -n "$target_result" ] && [ -n "$role_result" ]; then
67-
pytest_opts="$pytest_opts -m (\"($target_result) and ($role_result)\")"
67+
pytest_opts="$pytest_opts -m '($target_result) and ($role_result)'"
6868
elif [ -n "$target_result" ]; then
69-
pytest_opts="$pytest_opts -m (\"$target_result\")"
69+
pytest_opts="$pytest_opts -m \"$target_result\""
7070
elif [ -n "$role_result" ]; then
71-
pytest_opts="$pytest_opts -m (\"$role_result\")"
71+
pytest_opts="$pytest_opts -m \"$role_result\""
7272
fi
7373
fi
7474

0 commit comments

Comments
 (0)