Commit Graph

9 Commits

Author SHA1 Message Date
Dmitry Kuzmenko
6b0921e5ba Py3 tests fixes: don't mock non-callable objects with return_value.
mock = MagicMock(return_value='') works for functions: here mock() will
return the value (empty string). But mock returns the MagicMock object.
Not sure why but it worked in Py2, but in Py3 os.path.join(mock,
'something'), for instance, returns an error.

Fixed the issues by avoiding of using mocks where we can use simple
strings.
2017-05-25 12:33:43 +03:00
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
Pedro Algarvio
de9ccbdb43
Fix mocked test 2017-04-04 18:58:21 +01:00
Pedro Algarvio
d397763553
Adjust to the new LoaderModuleMockMixin usage 2017-03-28 19:03:59 +01:00
Pedro Algarvio
9b1e55aa85
Import the full module namespace to avoid import shadowing.
https://github.com/saltstack/salt/pull/39996#issuecomment-287857698
2017-03-28 19:02:47 +01:00
Pedro Algarvio
1f7a0aa65b
Proper mocking 2017-03-28 19:00:51 +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