-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
714 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.. click:: code42cli.cmds.auditlogs:audit_logs | ||
:prog: auditlogs | ||
:show-nested: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import pytest | ||
from integration import run_command | ||
|
||
ALERT_RULES_COMMAND = "code42 alert-rules" | ||
|
||
|
||
@pytest.mark.integration | ||
@pytest.mark.parametrize( | ||
"command", | ||
[ | ||
"{} list".format(ALERT_RULES_COMMAND), | ||
"{} show test-rule-id".format(ALERT_RULES_COMMAND), | ||
"{} list -f CSV".format(ALERT_RULES_COMMAND), | ||
"{} list -f TABLE".format(ALERT_RULES_COMMAND), | ||
"{} list -f RAW-JSON".format(ALERT_RULES_COMMAND), | ||
"{} list -f JSON".format(ALERT_RULES_COMMAND), | ||
"{} list --format CSV".format(ALERT_RULES_COMMAND), | ||
"{} list --format TABLE".format(ALERT_RULES_COMMAND), | ||
"{} list --format JSON".format(ALERT_RULES_COMMAND), | ||
"{} list --format RAW-JSON".format(ALERT_RULES_COMMAND), | ||
], | ||
) | ||
def test_alert_rules_command_returns_success_return_code(command): | ||
return_code, response = run_command(command) | ||
assert return_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"command, error_msg", | ||
[ | ||
( | ||
"{} add-user --rule-id test-rule-id".format(ALERT_RULES_COMMAND), | ||
"Missing option '-u' / '--username'.", | ||
), | ||
( | ||
"{} remove-user --rule-id test-rule-id".format(ALERT_RULES_COMMAND), | ||
"Missing option '-u' / '--username'.", | ||
), | ||
("{} add-user".format(ALERT_RULES_COMMAND), "Missing option '--rule-id'."), | ||
("{} remove-user".format(ALERT_RULES_COMMAND), "Missing option '--rule-id'."), | ||
("{} show".format(ALERT_RULES_COMMAND), "Missing argument 'RULE_ID'."), | ||
( | ||
"{} bulk add".format(ALERT_RULES_COMMAND), | ||
"Error: Missing argument 'CSV_FILE'.", | ||
), | ||
( | ||
"{} bulk remove".format(ALERT_RULES_COMMAND), | ||
"Error: Missing argument 'CSV_FILE'.", | ||
), | ||
], | ||
) | ||
def test_alert_rules_command_returns_error_exit_status_when_missing_required_parameters( | ||
command, error_msg | ||
): | ||
return_code, response = run_command(command) | ||
assert return_code == 2 | ||
assert error_msg in "".join(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pytest | ||
from integration import run_command | ||
|
||
DEPARTING_EMPLOYEE_COMMAND = "code42 departing-employee" | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"command, error_msg", | ||
[ | ||
("{} add".format(DEPARTING_EMPLOYEE_COMMAND), "Missing argument 'USERNAME'."), | ||
( | ||
"{} remove".format(DEPARTING_EMPLOYEE_COMMAND), | ||
"Missing argument 'USERNAME'.", | ||
), | ||
( | ||
"{} bulk add".format(DEPARTING_EMPLOYEE_COMMAND), | ||
"Missing argument 'CSV_FILE'.", | ||
), | ||
( | ||
"{} bulk remove".format(DEPARTING_EMPLOYEE_COMMAND), | ||
"Missing argument 'FILE'.", | ||
), | ||
], | ||
) | ||
def test_departing_employee_command_returns_error_exit_status_when_missing_required_parameters( | ||
command, error_msg | ||
): | ||
return_code, response = run_command(command) | ||
assert return_code == 2 | ||
assert error_msg in "".join(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
from integration import run_command | ||
|
||
HR_EMPLOYEE_COMMAND = "code42 high-risk-employee" | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"command, error_msg", | ||
[ | ||
("{} add".format(HR_EMPLOYEE_COMMAND), "Missing argument 'USERNAME'."), | ||
("{} remove".format(HR_EMPLOYEE_COMMAND), "Missing argument 'USERNAME'."), | ||
("{} bulk add".format(HR_EMPLOYEE_COMMAND), "Missing argument 'CSV_FILE'."), | ||
("{} bulk remove".format(HR_EMPLOYEE_COMMAND), "Missing argument 'FILE'."), | ||
( | ||
"{} bulk add-risk-tags".format(HR_EMPLOYEE_COMMAND), | ||
"Missing argument 'CSV_FILE'.", | ||
), | ||
( | ||
"{} bulk remove-risk-tags".format(HR_EMPLOYEE_COMMAND), | ||
"Missing argument 'CSV_FILE'.", | ||
), | ||
], | ||
) | ||
def test_hr_employee_command_returns_error_exit_status_when_missing_required_parameters( | ||
command, error_msg | ||
): | ||
return_code, response = run_command(command) | ||
assert return_code == 2 | ||
assert error_msg in "".join(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import pytest | ||
from integration import run_command | ||
|
||
LEGAL_HOLD_COMMAND = "code42 legal-hold" | ||
|
||
|
||
@pytest.mark.integration | ||
@pytest.mark.parametrize( | ||
"command", | ||
[ | ||
"{} list".format(LEGAL_HOLD_COMMAND), | ||
"{} show 984140047896012577".format(LEGAL_HOLD_COMMAND), | ||
"{} list -f CSV".format(LEGAL_HOLD_COMMAND), | ||
"{} list -f TABLE".format(LEGAL_HOLD_COMMAND), | ||
"{} list -f RAW-JSON".format(LEGAL_HOLD_COMMAND), | ||
"{} list -f JSON".format(LEGAL_HOLD_COMMAND), | ||
"{} list --format CSV".format(LEGAL_HOLD_COMMAND), | ||
"{} list --format TABLE".format(LEGAL_HOLD_COMMAND), | ||
"{} list --format JSON".format(LEGAL_HOLD_COMMAND), | ||
"{} list --format RAW-JSON".format(LEGAL_HOLD_COMMAND), | ||
], | ||
) | ||
def test_alert_rules_command_returns_success_return_code(command): | ||
return_code, response = run_command(command) | ||
assert return_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"command, error_msg", | ||
[ | ||
( | ||
"{} add-user --matter-id test-matter-id".format(LEGAL_HOLD_COMMAND), | ||
"Missing option '-u' / '--username'.", | ||
), | ||
( | ||
"{} remove-user --matter-id test-matter-id".format(LEGAL_HOLD_COMMAND), | ||
"Missing option '-u' / '--username'.", | ||
), | ||
( | ||
"{} add-user".format(LEGAL_HOLD_COMMAND), | ||
"Missing option '-m' / '--matter-id'.", | ||
), | ||
( | ||
"{} remove-user".format(LEGAL_HOLD_COMMAND), | ||
"Missing option '-m' / '--matter-id'.", | ||
), | ||
("{} show".format(LEGAL_HOLD_COMMAND), "Missing argument 'MATTER_ID'."), | ||
( | ||
"{} bulk add".format(LEGAL_HOLD_COMMAND), | ||
"Error: Missing argument 'CSV_FILE'.", | ||
), | ||
( | ||
"{} bulk remove".format(LEGAL_HOLD_COMMAND), | ||
"Error: Missing argument 'CSV_FILE'.", | ||
), | ||
], | ||
) | ||
def test_alert_rules_command_returns_error_exit_status_when_missing_required_parameters( | ||
command, error_msg | ||
): | ||
return_code, response = run_command(command) | ||
assert return_code == 2 | ||
assert error_msg in "".join(response) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.0.0" | ||
__version__ = "1.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.