mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
e32faa4a28
* `salt-call` default outputter returned from `salt.output.get_printout()` was `None` and `None` isn't callable neither outputs anything useful. In this case, the fault Outputter should be used. * `get_printout()` also tested for `txt_out` which now is, in the cleaned up parsers, `text_out`. Fixed.
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""
|
|
tests.integration.shell.call
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
:copyright: © 2012 UfSoft.org - :email:`Pedro Algarvio (pedro@algarvio.me)`
|
|
:license: Apache 2.0, see LICENSE for more details.
|
|
"""
|
|
|
|
import sys
|
|
|
|
# Import salt libs
|
|
from saltunittest import TestLoader, TextTestRunner
|
|
import integration
|
|
from integration import TestDaemon
|
|
|
|
|
|
class CallTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|
|
|
_call_binary_ = 'salt-call'
|
|
|
|
def test_default_output(self):
|
|
out = self.run_call('test.fib 3')
|
|
self.assertEqual(
|
|
"local: !!python/tuple\n- [0, 1, 1, 2]", '\n'.join(out[:-3])
|
|
)
|
|
|
|
def test_text_output(self):
|
|
out = self.run_call('--text-out test.fib 3')
|
|
self.assertEqual("local: ([0, 1, 1, 2]", ''.join(out).rsplit(",", 1)[0])
|
|
|
|
if __name__ == "__main__":
|
|
loader = TestLoader()
|
|
tests = loader.loadTestsFromTestCase(CallTest)
|
|
print('Setting up Salt daemons to execute tests')
|
|
with TestDaemon():
|
|
runner = TextTestRunner(verbosity=1).run(tests)
|
|
sys.exit(runner.wasSuccessful()) |