コード例 #1
0
ファイル: test_source_filter.py プロジェクト: code42/py42
def test_source_tab_urls_not_in_str_gives_correct_json_representation():
    items = [
        "test_sourceTabUrls_1", "test_sourceTabUrls_2", "test_sourceTabUrls_3"
    ]
    _filter = SourceTabUrls.not_in(items)
    expected = NOT_IN.format("sourceTabUrls", *sorted(items))
    assert str(_filter) == expected
コード例 #2
0
ファイル: test_source_filter.py プロジェクト: code42/py42
def test_source_category_not_in_str_gives_correct_json_representation():
    items = [
        "test_sourceCategory_1", "test_sourceCategory_2",
        "test_sourceCategory_3"
    ]
    _filter = SourceCategory.not_in(items)
    expected = NOT_IN.format("sourceCategory", *sorted(items))
    assert str(_filter) == expected
コード例 #3
0
def test_sync_destination_name_not_in_str_gives_correct_json_representation():
    items = [
        SyncDestination.GOOGLE_DRIVE, SyncDestination.BOX,
        SyncDestination.ICLOUD
    ]
    _filter = SyncDestination.not_in(items)
    expected = NOT_IN.format("syncDestination", *sorted(items))
    assert str(_filter) == expected
コード例 #4
0
def test_destination_category_not_in_str_gives_correct_json_representation():
    items = [
        DestinationCategory.CLOUD_STORAGE,
        DestinationCategory.MESSAGING,
        DestinationCategory.UNCATEGORIZED,
    ]
    _filter = DestinationCategory.not_in(items)
    expected = NOT_IN.format("destinationCategory", *items)
    assert str(_filter) == expected
コード例 #5
0
ファイル: test_risk_filter.py プロジェクト: code42/py42
def test_risk_indicator_not_in_str_gives_correct_json_representation():
    items = [
        RiskIndicator.FileCategories.EXECUTABLE,
        RiskIndicator.FileCategories.IMAGE,
        RiskIndicator.FileCategories.PDF,
    ]
    _filter = RiskIndicator.not_in(items)
    expected = NOT_IN.format("riskIndicatorNames", *items)
    assert str(_filter) == expected
コード例 #6
0
def test_destination_name_not_in_str_gives_correct_json_representation():
    items = [
        "Dropbox",
        "Reddit",
        "Windows 10",
    ]
    _filter = DestinationName.not_in(items)
    expected = NOT_IN.format("destinationName", *items)
    assert str(_filter) == expected
コード例 #7
0
def test_exposure_type_not_in_str_gives_correct_json_representation():
    items = [
        ExposureType.CLOUD_STORAGE,
        ExposureType.OUTSIDE_TRUSTED_DOMAINS,
        ExposureType.SHARED_TO_DOMAIN,
    ]
    _filter = ExposureType.not_in(items)
    expected = NOT_IN.format("exposure", *items)
    assert str(_filter) == expected
コード例 #8
0
def test_sync_destination_username_not_in_str_gives_correct_json_representation(
):
    items = ["*@example2.com", "*****@*****.**", "*****@*****.**"]
    _filter = SyncDestinationUsername.not_in(items)
    expected = NOT_IN.format("syncDestinationUsername", *items)
    assert str(_filter) == expected
コード例 #9
0
ファイル: test_alert_query.py プロジェクト: amoravec/py42
def test_actor_not_in_str_gives_correct_json_representation():
    items = ["test.testerson", "flag.flagerson", "mock.mockerson"]
    _filter = Actor.not_in(items)
    expected = NOT_IN.format("actor", *items)
    assert str(_filter) == expected
コード例 #10
0
def test_removable_media_serial_number_not_in_str_gives_correct_json_representation(
):
    items = ["name1", "name2", "name3"]
    _filter = RemovableMediaSerialNumber.not_in(items)
    expected = NOT_IN.format("removableMediaSerialNumber", *items)
    assert str(_filter) == expected
コード例 #11
0
def test_removable_media_partition_id_not_in_str_gives_correct_json_representation(
):
    items = ["name1", "name2", "name3"]
    _filter = RemovableMediaPartitionID.not_in(items)
    expected = NOT_IN.format("removableMediaPartitionId", *items)
    assert str(_filter) == expected
コード例 #12
0
def test_event_type_not_in_str_gives_correct_json_representation():
    items = ["eventType1", "eventType2", "eventType3"]
    _filter = EventType.not_in(items)
    expected = NOT_IN.format("eventType", *items)
    assert str(_filter) == expected
コード例 #13
0
ファイル: test_alert_query.py プロジェクト: amoravec/py42
def test_alert_state_not_in_str_gives_correct_json_representation():
    items = ["OPEN", "DISMISSED", "other"]
    _filter = AlertState.not_in(items)
    expected = NOT_IN.format("state", *items)
    assert str(_filter) == expected
コード例 #14
0
def test_public_ip_address_not_in_str_gives_correct_json_representation():
    items = ["publicIpAddress1", "publicIpAddress2", "publicIpAddress3"]
    _filter = PublicIPAddress.not_in(items)
    expected = NOT_IN.format("publicIpAddress", *items)
    assert str(_filter) == expected
コード例 #15
0
def test_device_username_not_in_str_gives_correct_json_representation():
    items = ["deviceUserName1", "deviceUserName2", "deviceUserName3"]
    _filter = DeviceUsername.not_in(items)
    expected = NOT_IN.format("deviceUserName", *items)
    assert str(_filter) == expected
コード例 #16
0
def test_private_ip_address_not_in_str_gives_correct_json_representation():
    items = ["privateIp1", "privateIp2", "privateIp3"]
    _filter = PrivateIPAddress.not_in(items)
    expected = NOT_IN.format("privateIpAddresses", *items)
    assert str(_filter) == expected
コード例 #17
0
ファイル: test_alert_query.py プロジェクト: amoravec/py42
def test_severity_not_in_str_gives_correct_json_representation():
    items = ["HIGH", "MEDIUM", "LOW"]
    _filter = Severity.not_in(items)
    expected = NOT_IN.format("severity", *items)
    assert str(_filter) == expected
コード例 #18
0
ファイル: test_alert_query.py プロジェクト: amoravec/py42
def test_rule_name_not_in_str_gives_correct_json_representation():
    items = ["rule 1", "rule 2", "rule 3"]
    _filter = RuleName.not_in(items)
    expected = NOT_IN.format("name", *items)
    assert str(_filter) == expected
コード例 #19
0
def test_tab_url_not_in_str_gives_correct_json_representation():
    items = ["tab1", "tab2", "tab3"]
    _filter = TabURL.not_in(items)
    expected = NOT_IN.format("tabUrls", *items)
    assert str(_filter) == expected
コード例 #20
0
def test_email_from_not_in_str_gives_correct_json_representation():
    items = ["email_from1", "email_from2", "email_from3"]
    _filter = EmailFrom.not_in(items)
    expected = NOT_IN.format("emailFrom", *items)
    assert str(_filter) == expected
コード例 #21
0
def test_window_title_not_in_str_gives_correct_json_representation():
    items = ["window1", "window2", "window3"]
    _filter = WindowTitle.not_in(items)
    expected = NOT_IN.format("tabTitles", *items)
    assert str(_filter) == expected
コード例 #22
0
def test_email_sender_not_in_str_gives_correct_json_representation():
    items = ["email_sender1", "email_sender2", "email_sender3"]
    _filter = EmailSender.not_in(items)
    expected = NOT_IN.format("emailSender", *items)
    assert str(_filter) == expected
コード例 #23
0
def test_os_hostname_not_in_str_gives_correct_json_representation():
    items = ["osHostName1", "osHostName2", "osHostName3"]
    _filter = OSHostname.not_in(items)
    expected = NOT_IN.format("osHostName", *items)
    assert str(_filter) == expected
コード例 #24
0
ファイル: test_alert_query.py プロジェクト: amoravec/py42
def test_description_not_in_str_gives_correct_json_representation():
    items = ["desc1", "desc2", "desc3"]
    _filter = Description.not_in(items)
    expected = NOT_IN.format("description", *items)
    assert str(_filter) == expected
コード例 #25
0
def test_email_policy_name_not_in_str_gives_correct_json_representation():
    items = ["test_policy1", "test_policy2", "test_policy3"]
    _filter = EmailPolicyName.not_in(items)
    expected = NOT_IN.format("emailDlpPolicyNames", *items)
    assert str(_filter) == expected
コード例 #26
0
def test_process_name_not_in_str_gives_correct_json_representation():
    items = ["n1", "n2", "n3"]
    _filter = ProcessName.not_in(items)
    expected = NOT_IN.format("processName", *items)
    assert str(_filter) == expected
コード例 #27
0
def test_email_recipients_not_in_str_gives_correct_json_representation():
    items = ["EmailRecipients1", "EmailRecipients2", "EmailRecipients3"]
    _filter = EmailRecipients.not_in(items)
    expected = NOT_IN.format("emailRecipients", *items)
    assert str(_filter) == expected
コード例 #28
0
def test_process_owner_not_in_str_gives_correct_json_representation():
    items = ["owner1", "owner2", "owner3"]
    _filter = ProcessOwner.not_in(items)
    expected = NOT_IN.format("processOwner", *items)
    assert str(_filter) == expected
コード例 #29
0
def test_email_subject_not_in_str_gives_correct_json_representation():
    items = ["test_subject1", "test_subject2", "test_subject3"]
    _filter = EmailSubject.not_in(items)
    expected = NOT_IN.format("emailSubject", *items)
    assert str(_filter) == expected
コード例 #30
0
def test_removable_media_volume_name_not_in_str_gives_correct_json_representation(
):
    items = ["name1", "name2", "name3"]
    _filter = RemovableMediaVolumeName.not_in(items)
    expected = NOT_IN.format("removableMediaVolumeName", *items)
    assert str(_filter) == expected