コード例 #1
0
ファイル: mesos_test.py プロジェクト: zhengpingwan/Tron
    def test_recover_disabled(self):
        cluster = MesosCluster('mesos-cluster-a.me', enabled=False)
        mock_task = mock.MagicMock()
        mock_task.get_mesos_id.return_value = 'this_task'
        cluster.recover(mock_task)

        assert 'this_task' not in cluster.tasks
        mock_task.exited.assert_called_once_with(None)
コード例 #2
0
ファイル: mesos_test.py プロジェクト: pombredanne/Tron
    def test_recover_disabled(self):
        cluster = MesosCluster('mesos-cluster-a.me', enabled=False)
        mock_task = mock.MagicMock()
        mock_task.get_mesos_id.return_value = 'this_task'
        cluster.recover(mock_task)

        assert 'this_task' not in cluster.tasks
        mock_task.exited.assert_called_once_with(None)
コード例 #3
0
ファイル: mesos_test.py プロジェクト: zhengpingwan/Tron
    def test_recover(self):
        cluster = MesosCluster('mesos-cluster-a.me')
        mock_task = mock.MagicMock()
        mock_task.get_mesos_id.return_value = 'this_task'
        cluster.recover(mock_task)

        assert 'this_task' in cluster.tasks
        assert cluster.tasks['this_task'] == mock_task
        cluster.runner.reconcile.assert_called_once_with(
            mock_task.get_config.return_value, )
        assert mock_task.started.call_count == 1
コード例 #4
0
ファイル: mesos_test.py プロジェクト: pombredanne/Tron
    def test_recover(self):
        cluster = MesosCluster('mesos-cluster-a.me')
        mock_task = mock.MagicMock()
        mock_task.get_mesos_id.return_value = 'this_task'
        cluster.recover(mock_task)

        assert 'this_task' in cluster.tasks
        assert cluster.tasks['this_task'] == mock_task
        cluster.runner.reconcile.assert_called_once_with(
            mock_task.get_config.return_value,
        )
        assert mock_task.started.call_count == 1