"""Test art_relations queries.""" import pytest from src.logic.art_relations.queries import queries @pytest.mark.parametrize( ('test_description', 'expected_result'), [ ( 'ff on', """ MERGE (p:Profile {{ profileId: toInteger($id), profileType: 'LabelProfile' }}) ON CREATE SET p.uuid = randomUUID(), p.fullCatalogAccess = false SET p.profileName = $login, p.language = $language, p.roles = $roles, p.updatedOn = datetime(), p.updatedBy = 'kinesis-to-neo4j/labelprofile_insert_cypher' WITH p MERGE (a:{resource_type} {{ id: toInteger($resource_id) }}) ON CREATE SET a.uuid = $uuid, a.createdAt = datetime(), a.createdBy = 'kinesis-to-neo4j/labelprofile_insert_cypher', a.lastModifiedAt = datetime(), a.lastModifiedBy = 'kinesis-to-neo4j/labelprofile_insert_cypher' MERGE (p)-[rel:HAS_ACCESS_TO]->(a) MERGE (p)-[fol:HAS_FOLLOWED]->(a) SET fol.dateCreated = datetime(), fol.automatic = TRUE MERGE (p)-[fol_enr:HAS_FOLLOWED_EMAIL_NOTIFICATION_REJECTION]->(a) SET fol_enr.dateCreated = datetime(), fol_enr.automatic = TRUE MERGE (p)-[fol_ennr:HAS_FOLLOWED_EMAIL_NOTIFICATION_NEW_RELEASE]->(a) SET fol_ennr.dateCreated = datetime(), fol_ennr.automatic = TRUE WITH p MATCH (s:Subscription) WHERE s.name in ['email_notification_rejection', 'email_notification_new_release'] MERGE (p)-[newrel:HAS_SUBSCRIPTION]->(s) WITH p, s MATCH(i:Identity {{ auth0UserId: $auth0_user_id }}) MERGE (i)-[hp:HAS_PROFILE]->(p) ON CREATE SET hp.createdAt = datetime(), hp.createdBy = 'kinesis-to-neo4j/get_labelprofile_insert_cypher', hp.lastModifiedAt = datetime(), hp.lastModifiedBy = 'kinesis-to-neo4j/get_labelprofile_insert_cypher' RETURN i, p, s """, # noqa: E501 ), ], ) def test_labelprofile_insert_cypher( mocker, test_description, expected_result, ): """Test labelprofile_insert_cypher.""" assert queries.get_labelprofile_insert_cypher() == expected_result