def test_executer_logs(self, mock_execute): mock_execute.side_effect = [("result", None)] executer = Executer("a_pod", "a-namespace") executer.logs() mock_execute.assert_called_once_with( "kubectl logs a_pod -n a-namespace --tail=-1", verbose=False )
def test_executer_logs_sincetime(self, mock_execute): mock_execute.side_effect = [("result", None)] executer = Executer("a_pod", "a-namespace") executer.logs(since_time="1970-01-01T00:00:00Z") mock_execute.assert_called_once_with( "kubectl logs a_pod -n a-namespace --tail=-1 --since-time='1970-01-01T00:00:00Z'", )
def test_executer_logs_tail(self, mock_execute): mock_execute.side_effect = [("result", None)] executer = Executer("a_pod", "a-namespace", container="a_container") executer.logs(tail=10) mock_execute.assert_called_once_with( "kubectl logs a_pod -n a-namespace --container a_container --tail=10", )
def test_executer_logs_tail(self, mock_execute): executer = Executer('a_pod', 'a-namespace', container='a_container', verbose=True) executer.logs(10) mock_execute.assert_called_once_with( 'kubectl logs a_pod -n a-namespace --container a_container --tail=10', verbose=True)
def test_executer_logs(self, mock_execute): executer = Executer('a_pod', 'a-namespace') executer.logs() mock_execute.assert_called_once_with( 'kubectl logs a_pod -n a-namespace --tail=-1', verbose=False)