Beispiel #1
0
 def test_uwsgi_stats(self):
     socket = "127.0.0.1:5050"
     mock = MagicMock(return_value='{"a": 1, "b": 2}')
     with patch.dict(uwsgi.__salt__, {"cmd.run": mock}):
         result = uwsgi.stats(socket)
         mock.assert_called_once_with(["uwsgi", "--connect-and-read", "{0}".format(socket)], python_shell=False)
         self.assertEqual(result, {"a": 1, "b": 2})
Beispiel #2
0
 def test_uwsgi_stats(self):
     socket = "127.0.0.1:5050"
     mock = MagicMock(return_value='{"a": 1, "b": 2}')
     with patch.dict(uwsgi.__salt__, {'cmd.run': mock}):
         result = uwsgi.stats(socket)
         mock.assert_called_once_with(
             'uwsgi --connect-and-read {0}'.format(socket))
         self.assertEqual(result, {'a': 1, 'b': 2})
Beispiel #3
0
 def test_uwsgi_stats(self):
     socket = "127.0.0.1:5050"
     mock = MagicMock(return_value='{"a": 1, "b": 2}')
     with patch.dict(uwsgi.__salt__, {'cmd.run': mock}):
         result = uwsgi.stats(socket)
         mock.assert_called_once_with(
             'uwsgi --connect-and-read {0}'.format(socket))
         self.assertEqual(result, {'a': 1, 'b': 2})
Beispiel #4
0
 def test_uwsgi_stats(self):
     socket = "127.0.0.1:5050"
     mock = MagicMock(return_value='{"a": 1, "b": 2}')
     with patch.dict(uwsgi.__salt__, {"cmd.run": mock}):
         result = uwsgi.stats(socket)
         mock.assert_called_once_with(
             ["uwsgi", "--connect-and-read", "{0}".format(socket)],
             python_shell=False,
         )
         self.assertEqual(result, {"a": 1, "b": 2})