Commit Graph

26 Commits

Author SHA1 Message Date
Bo Maryniuk
29b67b3b18 Refactor unit tests so they call class-based decorator 2018-01-17 14:13:25 +01:00
Bo Maryniuk
d0c54f43cc Git rebase spaghetti fix 2018-01-15 15:36:06 +01:00
Bo Maryniuk
5ca5046822 Refactor and rename tests while function has been renamed 2018-01-15 15:34:46 +01:00
Bo Maryniuk
6802593a5a Lintfix: E8302 2018-01-15 15:34:13 +01:00
Bo Maryniuk
1133e0c35d Lintfix: W0611 2018-01-15 15:34:13 +01:00
Bo Maryniuk
b3c3b8c679 Lintfix: E0102 2018-01-15 15:34:13 +01:00
Bo Maryniuk
a228ed5ddf Add unit test to unify result converted to false 2018-01-15 15:34:13 +01:00
Bo Maryniuk
48b9a70901 Fix unit test docstring 2018-01-15 15:33:49 +01:00
Bo Maryniuk
8de1301e2d Add unit test for result is converted to a True boolean type 2018-01-15 15:33:49 +01:00
Bo Maryniuk
4e9a5b8033 Fix docstrings 2018-01-15 15:33:21 +01:00
Bo Maryniuk
d9b4ac2d6d Test only comment section conversion 2018-01-15 15:33:21 +01:00
Bo Maryniuk
ac63d35703 Remove leftovers of the old unit test 2018-01-15 15:24:46 +01:00
Bo Maryniuk
e09c21bb8d Add unit test to unify an output data from the state 2018-01-15 15:24:46 +01:00
Bo Maryniuk
a976d1445e Add unit test to ensude there is "name", "result" and "comment" in the state output. 2018-01-15 15:24:20 +01:00
Bo Maryniuk
a9ba5a3fe3 Add unit test checking the entire return is of a dictionary type 2018-01-15 15:23:44 +01:00
Bo Maryniuk
014167c640 Add unit test for checking policy so the "changes" keyword contains a dictionary type 2018-01-15 15:23:08 +01:00
Bo Maryniuk
5902633b3f Remove obsolete unit test code 2018-01-15 15:21:19 +01:00
Bo Maryniuk
fa96d8c528 Use PyTest in tests 2018-01-15 15:20:51 +01:00
Dmitry Kuzmenko
f40cb3f2f1
Slots: bugfixes and tests. 2018-01-11 14:05:58 +03:00
Erik Johnson
8cdb9ea54f
[PY3] Add print_function import to files with unicode_literals already added
This makes the 2.x usage invalid syntax and forces the use of print as a
function. This adds the import to the files which I've updated in the
last couple of days but forgot to add it.
2017-12-15 12:14:18 -06:00
Erik Johnson
1bfc53fc57
Update file state/execution modules and associated files with unicode_literals
This updates the file state and execution modules to use
unicode_literals. Since the serializers and the cmd module are touched
by the file state/exec module, those are also updated here, as well as
the cmd state module, for good measure.

Additionally, I found that salt.utils.data.decode_dict (and decode_list)
are misnamed for what they actually do. Since they *encode* the
contents, the functions should be named encode_dict and encode_list,
respectively. And we also should have counterparts which actually
decode, so I've added them. The compatibility functions from salt.utils
still use the old "decode" names to preserve backward compatibility, but
they now invoke the renamed "encode" functions in salt.utils.data. Note
that this means that the compatibility functions
salt.utils.decode_dict/list, and their cognates in salt.utils.data now
do different things, but since the move to salt.utils.data is also
happening in the Oxygen release this is as good a time as any to correct
this oversight.

I've updated the jinja filter docs to include information on the renamed
jinja filters, and also added a section on jinja filter renaming to the
Oxygen release notes. There was another filter that I renamed during the
process of moving functions from salt.utils which I did not properly
document in the release notes, so this is now included along with the
others.
2017-12-13 16:43:45 -06:00
Aneesh Agrawal
ba63920874 Support states returning a list for ret['comment']
Some states are complicated and multiple subparts,
or maybe cross-call into __states__ if they manage subresources.
In these cases, they will have multiple comments.
Make this more ergonomic by supporting a list of strings as the
value for ret['comment'] in state returns and documenting this.
By joining comments on newlines, it is possible to combine
single-line and multi-line comments cleanly, as opposed to e.g. commas.

The driving impetus for this is some of the boto modules.
An update to the boto_sqs module is included as an example.

Add a check that outgoing state return data has the right shape,
and add a testcase as well.
Fix the NPM state tests and the saltmod runner & wheel state functions
to comply with the prescribed format.
2017-09-05 19:52:42 +00:00
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
Pedro Algarvio
40a64191a1
Absolute imports and A LOT of code cleanup. 2017-03-01 01:33:07 +00:00
Pedro Algarvio
3beb3fb801
Move whatever we need from salttesting to salt.
Let's drop the salttesting dependency cycle.
2017-02-28 22:52:49 +00:00
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00