
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())

import sys

# Import salt libs
from saltunittest import TestLoader, TextTestRunner, skipIf
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])

    @skipIf(sys.platform.startswith('win'), 'This test does not apply on Win')
    def test_user_delete_kw_output(self):
        ret = self.run_call('-d user.delete')
        self.assertIn(
            'salt \'*\' user.delete name remove=True force=True',
            ''.join(ret)
        )


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())

Test to make sure we're outputting kwargs on the user.delete documentation.
Test to make sure we're outputting kwargs on the user.delete documentation.

  
  import sys
  
  # Import salt libs
- from saltunittest import TestLoader, TextTestRunner
+ from saltunittest import TestLoader, TextTestRunner, skipIf
  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])
  
+     @skipIf(sys.platform.startswith('win'), 'This test does not apply on Win')
+     def test_user_delete_kw_output(self):
+         ret = self.run_call('-d user.delete')
+         self.assertIn(
+             'salt \'*\' user.delete name remove=True force=True',
+             ''.join(ret)
+         )
+ 
+ 
  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())
+ 
Test to make sure we're outputting kwargs on the user.delete documentation.
## Code Before:

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())
## Instruction:
Test to make sure we're outputting kwargs on the user.delete documentation.
## Code After:

import sys

# Import salt libs
from saltunittest import TestLoader, TextTestRunner, skipIf
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])

    @skipIf(sys.platform.startswith('win'), 'This test does not apply on Win')
    def test_user_delete_kw_output(self):
        ret = self.run_call('-d user.delete')
        self.assertIn(
            'salt \'*\' user.delete name remove=True force=True',
            ''.join(ret)
        )


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())
