Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_load_ecr_repository_images(neo4j_session):
repo_data = tests.data.aws.ecr.DESCRIBE_REPOSITORIES
cartography.intel.aws.ecr.load_ecr_repositories(
neo4j_session,
repo_data,
TEST_REGION,
TEST_ACCOUNT_ID,
TEST_UPDATE_TAG,
)
data = tests.data.aws.ecr.LIST_REPOSITORY_IMAGES
cartography.intel.aws.ecr.load_ecr_images(
neo4j_session,
data,
TEST_REGION,
TEST_UPDATE_TAG,
)
def test_load_roles(neo4j_session):
data = tests.data.aws.iam.LIST_ROLES['Roles']
cartography.intel.aws.iam.load_roles(
neo4j_session,
data,
TEST_ACCOUNT_ID,
TEST_UPDATE_TAG
)
def test_transform_and_load_user_extensions(neo4j_session):
"""
Ensure we can transform and load users and extension mapping.
"""
users_res = tests.data.crxcavator.crxcavator.USER_RESPONSE
type(users_res)
users_list, extensions_list, user_extensions_list = \
cartography.intel.crxcavator.crxcavator.transform_user_extensions(users_res)
cartography.intel.crxcavator.crxcavator.load_user_extensions(
users_list,
user_extensions_list,
neo4j_session,
TEST_UPDATE_TAG,
)
query = """
MATCH(user:GSuiteUser{email:{GSuiteEmail}})
RETURN user.id, user.email
"""
expected_user_email = 'user@example.com'
nodes = neo4j_session.run(query, GSuiteEmail=expected_user_email)
actual_nodes = list([
(
def _ensure_local_neo4j_has_test_extensions_data(neo4j_session):
cartography.intel.crxcavator.crxcavator.load_extensions(
tests.data.crxcavator.crxcavator.TRANSFORMED_EXTENSIONS_DATA,
neo4j_session,
TEST_UPDATE_TAG,
)