コード例 #1
0
 def test_cluster_status(self):
     self.check_output.return_value = b'Cluster status OK'
     actions.cluster_status([])
     self.check_output.assert_called_once_with(['rabbitmqctl',
                                                'cluster_status'],
                                               universal_newlines=True)
     self.action_set.assert_called()
コード例 #2
0
 def test_cluster_status(self):
     self.check_output.return_value = b'Cluster status OK'
     actions.cluster_status([])
     self.check_output.assert_called_once_with(['rabbitmqctl',
                                                'cluster_status'],
                                               universal_newlines=True)
     self.action_set.assert_called()
コード例 #3
0
 def test_cluster_status_execption(self):
     self.check_output.side_effect = actions.CalledProcessError(
         1, "Failure")
     actions.cluster_status([])
     self.check_output.assert_called_once_with(
         ['rabbitmqctl', 'cluster_status'], universal_newlines=True)
     self.action_set.assert_called()
     self.action_fail.assert_called()
コード例 #4
0
 def test_cluster_status_exception(self):
     self.check_output.side_effect = actions.CalledProcessError(1,
                                                                "Failure")
     actions.cluster_status([])
     self.check_output.assert_called_once_with(['rabbitmqctl',
                                                'cluster_status'],
                                               universal_newlines=True)
     self.action_set.assert_called()
     self.action_fail.assert_called()
コード例 #5
0
ファイル: test_actions.py プロジェクト: hemanthnakkina/hotsos
 def test_cluster_status_json(self):
     self.rabbitmq_version_newer_or_equal.return_value = True
     self.check_output.return_value = json.dumps(
         {"Status": "Cluster status OK"})
     actions.cluster_status([])
     self.check_output.assert_called_once_with(
         ['rabbitmqctl', 'cluster_status', '--formatter', 'json'],
         universal_newlines=True)
     self.action_set.assert_called()
コード例 #6
0
ファイル: test_actions.py プロジェクト: hemanthnakkina/hotsos
 def test_cluster_status_exception_json(self):
     self.rabbitmq_version_newer_or_equal.return_value = True
     self.check_output.side_effect = actions.CalledProcessError(
         1, "Failure")
     actions.cluster_status([])
     self.check_output.assert_called_once_with(
         ['rabbitmqctl', 'cluster_status', '--formatter', 'json'],
         universal_newlines=True)
     self.action_set.assert_called()
     self.action_fail.assert_called()