Commit graph

6 commits

Author SHA1 Message Date
patchback[bot]
4d4e626f95
[PR #9664/439da9e6 backport][stable-10] test helper unit tests: reformat YAML files (#9667)
test helper unit tests: reformat YAML files (#9664)

(cherry picked from commit 439da9e6da)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-02-01 17:01:24 +01:00
patchback[bot]
92e4bd184d
[PR #9226/b429e8a2 backport][stable-10] xfconf/xfconf_info: add return value version (#9359)
xfconf/xfconf_info: add return value version (#9226)

* xfconf/xfconf_info: add return value version

* add changelog frag

* adapt test to helper improvements

* rollback copyright update

* replace tab with spaces in test yamls

(cherry picked from commit b429e8a2cf)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-12-24 14:05:31 +01:00
patchback[bot]
a89990ab9b
[PR #9242/88ea025d backport][stable-10] test helper improvements (#9247)
test helper improvements (#9242)

(cherry picked from commit 88ea025d12)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-12-14 10:44:16 +01:00
Alexei Znamensky
8ef77d8664
unit test helper: big revamp (#8894)
* initial commit

* multiple changes:

- TestCaseContext fixture no longer need to autouse=True
- Helper.from_module() allows extra param to specify yaml file
- test_django_check: adjusted .py and .yaml

* set fixtures per testcase

* set fixtures per testcase

* rollback to original state

* patch_ansible_module fixture

- now it works not only in parametrized functions but also directly with args

* tests/unit/plugins/modules/helper.py

- improved encapsulation, class Helper no longer knows details about test cases
- test functions no longer parametrized, that allows using test case fixtures per test function
- renamed 'context' to 'mock'

* enable Helper.from_list(), better param name 'ansible_module'

* adjusted test fiels to new helper

* remove unnecessary .license file

* fix bracket

* fix reference name

* Update tests/unit/plugins/modules/helper.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* revert to parametrized test func instead of multiple funcs

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-09-28 08:17:36 +03:00
Alexei Znamensky
17c7687283
DRY: using YAML anchors and aliases (#7248) 2023-09-13 00:49:23 +12:00
Alexei Znamensky
6303096648
xfconf*: using yaml-specified unit tests (#7170) 2023-08-29 21:06:38 +02:00