Skip to content

Commit

Permalink
substring match
Browse files Browse the repository at this point in the history
  • Loading branch information
achantavy committed Nov 14, 2024
1 parent 5a31913 commit e995a65
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,21 @@
'github_username': 'mbsimp-son', # pure lowercase
},
]

FAKE_EMPLOYEE2_DATA = [
{
'id': 123,
'email': '[email protected]',
'first_name': 'Homer',
'last_name': 'Simpson',
'name': 'Homer Simpson',
'github_username': 'jsimpso', # substring
},
{
'id': 456,
'email': '[email protected]',
'first_name': 'Marge',
'last_name': 'Simpson',
'github_username': 'mbsimp', # substring
},
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from cartography.client.core.tx import load
from cartography.intel.github.users import load_organization_users
from tests.data.graph.querybuilder.sample_data.case_insensitive_prop_ref import FAKE_EMPLOYEE_DATA
from tests.data.graph.querybuilder.sample_data.case_insensitive_prop_ref import FAKE_EMPLOYEE2_DATA
from tests.data.graph.querybuilder.sample_data.case_insensitive_prop_ref import FAKE_GITHUB_ORG_DATA
from tests.data.graph.querybuilder.sample_data.case_insensitive_prop_ref import FAKE_GITHUB_USER_DATA
from tests.data.graph.querybuilder.sample_models.fake_emps_githubusers_fuzzy import FakeEmp2Schema
Expand All @@ -19,7 +19,7 @@ def test_load_team_members_data_fuzzy(neo4j_session):
)

# Act: Create team members
load(neo4j_session, FakeEmp2Schema(), FAKE_EMPLOYEE_DATA, lastupdated=TEST_UPDATE_TAG)
load(neo4j_session, FakeEmp2Schema(), FAKE_EMPLOYEE2_DATA, lastupdated=TEST_UPDATE_TAG)

# Assert we can create relationships using a fuzzy, case insensitive match
assert check_rels(neo4j_session, 'FakeEmployee2', 'email', 'GitHubUser', 'username', 'IDENTITY_GITHUB') == {
Expand Down

0 comments on commit e995a65

Please sign in to comment.