Commit Graph

15 Commits (48dfe8e21524a84e87d4d1f6ec49edb9c2d7c68c)

Author SHA1 Message Date
Sam Doran cd473dfb2f
play - validate hosts entries (#74147)
* Change tests to pytest-style tests
* Add tests for invalid hosts
* Validate host inputs
  - check for empty values
  - check for None
  - check for values that are not a sequence and are not strings
  - add unit tests

* Move play name setting to get_name() and out of load()
* Add _validate_hosts() method
  By defining this method, it gets called automatically by FieldAttributeBase.validate().
3 years ago
Rick Elrod bd1acb74c8
[playbook/play.py] Increase error test coverage (#74217)
Change:
- Mostly increase error coverage for various conditions in play.py
- Also fix a string in an error, where get_name() was called before
  self.name was read in, so get_name() was always ''.

Test Plan:
- new tests

Signed-off-by: Rick Elrod <rick@elrod.me>

* Fix regex for py2 and py3

Signed-off-by: Rick Elrod <rick@elrod.me>

* py2 hates me

Signed-off-by: Rick Elrod <rick@elrod.me>
3 years ago
Mads Jensen ecc8e51044 Remove empty overridden unittest.setUp and unittest.tearDown methods. 5 years ago
Andrey Klychkov 21863d48f3 unit tests: remove unused imports (#60462) 5 years ago
Andrey Klychkov 64e3cb0fa8 Unit tests: remove unused imports (#59812)
* Unit tests: remove unused imports

* Unit tests: remove unused imports, fix
5 years ago
Matt Clay 3033fd96b0
Move unit test compat code out of `lib/ansible/`. (#46996)
* Move ansible.compat.tests to test/units/compat/.
* Fix unit test references to ansible.compat.tests.
* Move builtins compat to separate file.
* Fix classification of test/units/compat/ dir.
6 years ago
Matt Clay d913f69ba1 PEP 8 W291 whitespace cleanup. 8 years ago
Matt Clay 39c5c558f8 Switch tests from sudo to become. (#17694) 8 years ago
jctanner 373b23cc24 Fix mock loader for osx /etc symlinks (#16074)
Fix role based unit tests for osx via mock.patch
8 years ago
James Cammarata dfa33d0f23 Tweak variable manager use in role includes to avoid test failures 9 years ago
James Cammarata 993ce592b1 Update unit tests for flush_handlers fix 9 years ago
Pierre-Louis Bonicoli 8c392a94b7 Play.get_name: remove prefix, return name only 9 years ago
James Cammarata 1ca8cb8553 Fixing up v2 unit tests 9 years ago
Matt Martz a0fc8bb0bd Testing additions and fixes
* Fix import pathing for units.mock
* Add some additional requirements
* Use compileall to test compatiblity with different python versions
9 years ago
James Cammarata ce3ef7f4c1 Making the switch to v2 9 years ago