Пример #1
0
 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
     )
Пример #2
0
 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'",
     )
Пример #3
0
 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",
     )
Пример #4
0
 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)
Пример #5
0
 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)