Exemple #1
0
 def test_run_help_should_give_run_help(self):
     with mock.patch('sys.stdout', new=io.StringIO()) as fake_out:
         with self.assertRaises(SystemExit):
             manage()
         self.assertIn(
             'Run the HTTP server as configured to handle requests',
             fake_out.getvalue())
Exemple #2
0
#!/usr/bin/env python
from skill_sdk.manage import manage

manage()
Exemple #3
0
 def test_test(self, exit_mock, test_mock, report_mock, cov_mock):
     manage()
     test_mock.assert_called_once()
     report_mock.assert_called_once()
     cov_mock.assert_called_once()
Exemple #4
0
 def test_run_with_t(self, main_mock):
     manage()
     main_mock.assert_called_with(local=False, dev=True, cache=True)
Exemple #5
0
 def test_run_with_l_removed(self, main_mock):
     """ Make sure "--local" param is stripped from arguments list before being passed to Gunicorn
     """
     manage()
     import sys
     self.assertNotIn('--local', sys.argv)
Exemple #6
0
 def test_run_should_run_runner(self, main_mock):
     manage()
     main_mock.assert_called_with(dev=False, local=False, cache=True)
Exemple #7
0
 def test_help_should_give_help(self):
     with mock.patch('sys.stdout', new=io.StringIO()) as fake_out:
         with self.assertRaises(SystemExit):
             manage()
         self.assertIn('usage: manage.py', fake_out.getvalue())
Exemple #8
0
 def test_manage_translate(self, *args):
     with patch('sys.exit') as exit_mock:
         manage()
         exit_mock.assert_called_once_with('ok')
Exemple #9
0
 def test_version(self):
     with mock.patch('sys.stdout', new=io.StringIO()) as fake_out:
         manage()
         self.assertIn('1', fake_out.getvalue())
         self.assertNotIn(' ', fake_out.getvalue())