File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,10 @@ def run_command(command):
2727 output = process .before
2828 response = encode_response (output ).splitlines ()
2929 except pexpect .TIMEOUT :
30- return 1 , response
31- return 0 , response
30+ process .close ()
31+ return process .exitstatus , response
32+ process .close ()
33+ return process .exitstatus , response
3234
3335
3436__all__ = [run_command ]
Original file line number Diff line number Diff line change 11from datetime import datetime
22from datetime import timedelta
33
4+ import pytest
45from integration import run_command
56
6- BASE_COMMAND = "code42 auditlogs search -b"
7+ BASE_COMMAND = "code42 audit-logs search -b"
8+ begin_date = datetime .utcnow () - timedelta (days = - 10 )
9+ begin_date_str = begin_date .strftime ("%Y-%m-%d %H:%M:%S" )
710
811
9- def test_auditlogs_search ():
10- begin_date = datetime .utcnow () - timedelta (days = - 10 )
11- begin_date_str = begin_date .strftime ("%Y-%m-%d %H:%M:%S" )
12- return_code , response = run_command (BASE_COMMAND + begin_date_str )
12+ @pytest .mark .parametrize ("command" , [("{} '{}'" .format (BASE_COMMAND , begin_date_str ))])
13+ def test_auditlogs_search (command ):
14+ return_code , response = run_command (command )
1315 assert return_code == 0
You can’t perform that action at this time.
0 commit comments