Split basic units (#33510)

Split the one monolithic test for basic.py into several files

* Split test_basic.py along categories.
  This is preliminary to get a handle on things.  Eventually we may want
  to further split it so each file is only testing a single function.
* Cleanup unused imports from splitting test_basic.py
* Port atomic_move test to pytest.
  Working on getting rid of need to maintain procenv
* Split a test of symbolic_mode_to_octal to follow unittest best practices
  Each test should only invoke the function under test once
* Port test_argument_spec to pytest.
* Fix suboptions failure
This commit is contained in:
Toshio Kuratomi 2017-12-18 10:17:13 -08:00 committed by GitHub
parent ba32827f3b
commit 370a7ace4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1330 additions and 1359 deletions

View file

@ -7,8 +7,6 @@ from __future__ import (absolute_import, division)
__metaclass__ = type
import json
import sys
from itertools import chain
import pytest
@ -103,7 +101,7 @@ class TestAnsibleModuleExitValuesRemoved:
for s, r, e in DATA), # pylint: disable=undefined-variable
indirect=['am', 'stdin'])
def test_exit_json_removes_values(self, am, capfd, return_val, expected):
with pytest.raises(SystemExit) as ctx:
with pytest.raises(SystemExit):
am.exit_json(**return_val)
out, err = capfd.readouterr()
@ -116,7 +114,7 @@ class TestAnsibleModuleExitValuesRemoved:
indirect=['am', 'stdin'])
def test_fail_json_removes_values(self, am, capfd, return_val, expected):
expected['failed'] = True
with pytest.raises(SystemExit) as ctx:
with pytest.raises(SystemExit):
am.fail_json(**return_val) == expected
out, err = capfd.readouterr()