Skip to content

Commit

Permalink
Chore/trust integration tests (#370)
Browse files Browse the repository at this point in the history
* adding trustedactivities integration tests

* styling

* Update build.yml

* adding get-all integration test case with optional params

* re-running check after merging mock-server service
  • Loading branch information
tora-kozic committed Sep 20, 2021
1 parent 9925d24 commit a895e2b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
127.0.0.1 exfiltration-data-service
127.0.0.1 connected-server
127.0.0.1 cases
127.0.0.1 trusted-activities-service
EOF
- name: Start up the mock servers
run: cd code42-mock-servers; docker-compose up -d --build
Expand Down
39 changes: 39 additions & 0 deletions tests/integration/test_trustedactivites.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import pytest
from tests.integration.conftest import assert_successful_response


@pytest.mark.integration
class TestTrustedActivities:
@pytest.fixture(scope="module")
def trusted_activity(self, connection):
return connection.trustedactivities.create("DOMAIN", "test.com")

def test_get_all_trusted_activities(
self, connection,
):
page_gen = connection.trustedactivities.get_all()
for response in page_gen:
assert_successful_response(response)
break

def test_get_all_trusted_activities_with_optional_params(
self, connection,
):
page_gen = connection.trustedactivities.get_all(type="DOMAIN", page_size=1)
for response in page_gen:
assert_successful_response(response)
break

def test_get_trusted_activity(self, connection, trusted_activity):
response = connection.trustedactivities.get(trusted_activity["resourceId"])
assert_successful_response(response)

def test_update_trusted_activity(self, connection, trusted_activity):
response = connection.trustedactivities.update(
trusted_activity["resourceId"], description="integration test case"
)
assert_successful_response(response)

def test_delete_trusted_activity(self, connection, trusted_activity):
response = connection.trustedactivities.delete(trusted_activity["resourceId"])
assert_successful_response(response)

0 comments on commit a895e2b

Please sign in to comment.