Commit Graph

283 Commits

Author SHA1 Message Date
rallytime
ab6cc1c741
Update old utils paths to use new paths 2018-08-28 11:41:38 -04:00
rallytime
ac406c49a7
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/ext/win_inet_pton.py
  - salt/pillar/git_pillar.py
  - tests/integration/cli/test_batch.py
  - tests/integration/modules/test_archive.py
  - tests/integration/modules/test_pkg.py
  - tests/integration/states/test_file.py
  - tests/support/case.py
  - tests/whitelist.txt
2018-08-28 11:22:47 -04:00
Daniel Wozniak
d50324b4b5
Merge branch '2017.7' into more_tests 2018-08-27 16:30:10 -07:00
Daniel A Wozniak
cd6706e9f0
Fix merge wart 2018-08-27 14:36:40 -07:00
Daniel A Wozniak
3e55d10584
Platform module doesn't exist in 2017.7 2018-08-27 00:44:36 -07:00
Daniel A. Wozniak
0394ece642
The set command does not work like inline env vars
Remove set command prefix on windows since it can not be run inline with
other commands.
2018-08-27 00:44:35 -07:00
Daniel A. Wozniak
19911987b7
Fix review nits 2018-08-26 17:03:16 -07:00
Daniel A. Wozniak
6abc2daf56
Re-factor dedent to fix warts
- textwarp.dedent does not support bytes on py3
- make sure to preserve trailing newlines
2018-08-24 10:46:50 -07:00
Daniel A. Wozniak
75b2e3d990
Use salt.utils.to_* functions 2018-08-24 09:35:02 -07:00
Daniel A. Wozniak
fa78a7b2ee
Add dedent that sets line endings 2018-08-24 09:35:00 -07:00
Michael Calmer
6224f7b551
calling range is going up to the upper limit but not including it 2018-08-23 13:08:04 -04:00
Erik Johnson
8bda1e5ae3
Merge pull request #49091 from terminalmage/rename-test-files
Rename/re-organize test files in 2018.3 branch
2018-08-17 07:26:43 -05:00
Erik Johnson
ec258e235d
Add integration tests for yaml and json filters 2018-08-14 17:02:17 -05:00
Erik Johnson
fa76cb6ada
Move inspectlib tests to conform with naming convention 2018-08-14 13:53:29 -05:00
Erik Johnson
81e38239fe
Move shared kernelpkg test cases to tests/support/ 2018-08-14 13:53:29 -05:00
Nicole Thomas
90c2f026b3
Merge pull request #49077 from rallytime/bp-49075
Back-port #49075 to 2018.3
2018-08-13 15:59:59 -04:00
Nicole Thomas
0e1ed7b923
Merge pull request #49055 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-08-13 15:20:10 -04:00
Daniel Wallace
5e07b8306b
fix last async issue 2018-08-13 12:25:49 -04:00
rallytime
201031fa8a
Merge branch '2017.7' into '2018.3'
Conflicts:
  - 	doc/man/salt.7
  - 	doc/ref/configuration/minion.rst
  - 	salt/cloud/clouds/ec2.py
  - 	salt/returners/highstate_return.py
  - 	tests/support/gitfs.py
  - 	tests/unit/loader/test_loader.py
2018-08-10 13:12:14 -04:00
Bo Maryniuk
47078a300f Remove async keyword, moving it into the kwargs. 2018-08-10 15:59:24 +02:00
Bo Maryniuk
31dccc4fdf fix unicode literals 2018-08-10 15:59:24 +02:00
Erik Johnson
0441cd56ef
Add optimization_order to mocking 2018-08-08 11:22:52 -05:00
rallytime
15bfba7143
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/modules/slsutil.py
  - salt/modules/win_timezone.py
  - salt/states/pkg.py
  - tests/integration/states/test_pkg.py
2018-07-31 18:18:58 -04:00
Gareth J. Greenaway
11cb86e6eb
General cleanup in pkg state, reducing duplicate code. Fixing the requires_salt_modules decorator, sys.doc was returning too much information for the event to handle. This change specifically calls sys.doc with the module name. 2018-07-31 09:46:05 -07:00
Nicole Thomas
27a0e95174
Merge pull request #48279 from terminalmage/mock_open-docs
Add documentation/further enhancements to rewritten mock_open
2018-06-25 09:12:29 -04:00
Erik Johnson
3b6356f4b0
Raise TypeError when trying to read from filehandles not opened for reading 2018-06-23 21:27:58 -05:00
Erik Johnson
0e8c83bac6
2 MockFH enhancements:
1. Raise appropriate TypeErrors when wrong type is written
2. Don't raise exception about read_data unless we actually try to read
   from the filehandle. This makes it a bit more permissive when testing
   code where the file is only being written to.
2018-06-23 15:00:26 -05:00
rallytime
84ec655c24
Merge branch '2017.7' into '2018.3'
Conflicts:
  - doc/ref/configuration/minion.rst
  - salt/minion.py
  - salt/modules/dockermod.py
  - salt/modules/lxc.py
  - salt/utils/__init__.py
  - tests/unit/modules/test_mount.py
2018-06-21 14:22:15 -04:00
Ch3LL
236773e3e9
Skip new sha256 files on repo.saltstack.com/windows 2018-06-20 14:28:31 -04:00
Erik Johnson
1cbe89feee
Implement tell() for filehandle iteration 2018-06-18 16:23:35 -05:00
Erik Johnson
38df912fa6
Operate on a copy of the read_data
This keeps us from mangling it if it contains lists, which we would be
popping items off of. We don't want to pop items from the list that was
passed in.
2018-06-18 14:45:40 -05:00
Erik Johnson
67c036dc2d
Add MockCall to tests.support.mock to track calls 2018-06-18 10:34:33 -05:00
Erik Johnson
fd9d700157
Add additional docs to MockOpen class 2018-06-18 00:28:06 -05:00
Erik Johnson
fc0aa9934f
Track call_count in MockOpen 2018-06-18 00:21:26 -05:00
Erik Johnson
51b3faa7b4
Add support for passing multiple strings for a given match in read_data 2018-06-18 00:21:26 -05:00
Erik Johnson
f5823252bb
Track call args/kwargs in MockFH
This allows for them to be verified in tests
2018-06-18 00:21:25 -05:00
Erik Johnson
335591ca90
Mock the seek function in MockFH 2018-06-18 00:21:25 -05:00
Erik Johnson
2be19cfa89
Report correct location when reading using explicit size and EOF reached 2018-06-18 00:21:25 -05:00
Erik Johnson
5ec95ba5ca
On second thought, actually implement tell() 2018-06-18 00:21:25 -05:00
Erik Johnson
19022eb9e5
Add tell mock to MockFH 2018-06-18 00:21:25 -05:00
Erik Johnson
4e67955572
Replace the rest of mock_open with a class 2018-06-18 00:21:25 -05:00
Erik Johnson
836fde9a30
Allow Python 2 to accept an exception as read_data 2018-06-18 00:21:25 -05:00
Erik Johnson
543385fd02
Add writelines_calls property 2018-06-18 00:21:25 -05:00
Erik Johnson
42fa842456
Make read funcs mocks so their calls can be tracked
Also add a property func as a shorthand to return all the write calls
for a given filehandle.
2018-06-18 00:21:25 -05:00
Erik Johnson
b9200dbc3e
add a dict containing the handles to the mock_open return object
This allows tests to access the MockFH objects opened during the
execution of the unit test.
2018-06-18 00:16:03 -05:00
Erik Johnson
852ba4b982
Add mocked close() function to MockFH 2018-06-18 00:16:02 -05:00
Erik Johnson
1861e9b944
mock_open: rewrite multi-file support
The initial approach tied all opened files to the same mocked
filehandle. This new approach moves all the read functions into a class,
and then uses a separate instance of that class for each opened file.
2018-06-18 00:16:02 -05:00
Erik Johnson
5e6b539770
Use function for empty string
Missed this when making changes for multi-file support
2018-06-18 00:16:02 -05:00
Erik Johnson
5d09b178d7
Separate mocked file contents per filename, not glob
This allows for multiple opens of a file matching the same glob.
Otherwise, subsequent opens would already be at EOF.
2018-06-18 00:16:02 -05:00
Erik Johnson
875102f538
Modify mock_open to support multiple file paths 2018-06-18 00:16:02 -05:00