8
8
from db .python .tables .family_participant import FamilyParticipantTable
9
9
from models .enums import SearchResponseType
10
10
from models .models import (
11
+ PRIMARY_EXTERNAL_ORG ,
11
12
AssayUpsertInternal ,
12
13
FamilySearchResponseData ,
13
14
ParticipantSearchResponseData ,
@@ -52,7 +53,7 @@ async def test_search_unavailable_sample_by_internal_id(self):
52
53
Mock this in testing by limiting scope to non-existent project IDs
53
54
"""
54
55
sample = await self .slayer .upsert_sample (
55
- SampleUpsertInternal (external_id = 'EX001' , type = 'blood' )
56
+ SampleUpsertInternal (external_ids = { PRIMARY_EXTERNAL_ORG : 'EX001' } , type = 'blood' )
56
57
)
57
58
cpg_id = sample_id_format (sample .id )
58
59
@@ -67,7 +68,7 @@ async def test_search_isolated_sample_by_id(self):
67
68
Search by valid CPG sample ID (special case)
68
69
"""
69
70
sample = await self .slayer .upsert_sample (
70
- SampleUpsertInternal (external_id = 'EX001' , type = 'blood' )
71
+ SampleUpsertInternal (external_ids = { PRIMARY_EXTERNAL_ORG : 'EX001' } , type = 'blood' )
71
72
)
72
73
cpg_id = sample_id_format (sample .id )
73
74
results = await self .schlay .search (query = cpg_id , project_ids = [self .project_id ])
@@ -87,7 +88,7 @@ async def test_search_isolated_sequencing_group_by_id(self):
87
88
Search by valid CPG sequencing group ID (special case)
88
89
"""
89
90
sample = await self .slayer .upsert_sample (
90
- SampleUpsertInternal (external_id = 'EXS001' , type = 'blood' )
91
+ SampleUpsertInternal (external_ids = { PRIMARY_EXTERNAL_ORG : 'EXS001' } , type = 'blood' )
91
92
)
92
93
sg = await self .sglayer .upsert_sequencing_groups (
93
94
[
@@ -134,7 +135,7 @@ async def test_search_isolated_sample_by_external_id(self):
134
135
should only return one result
135
136
"""
136
137
sample = await self .slayer .upsert_sample (
137
- SampleUpsertInternal (external_id = 'EX001' , type = 'blood' )
138
+ SampleUpsertInternal (external_ids = { PRIMARY_EXTERNAL_ORG : 'EX001' } , type = 'blood' )
138
139
)
139
140
results = await self .schlay .search (query = 'EX001' , project_ids = [self .project_id ])
140
141
@@ -159,7 +160,7 @@ async def test_search_participant_isolated(self):
159
160
should only return one result
160
161
"""
161
162
p = await self .player .upsert_participant (
162
- ParticipantUpsertInternal (external_id = 'PART01' )
163
+ ParticipantUpsertInternal (external_ids = { PRIMARY_EXTERNAL_ORG : 'PART01' } )
163
164
)
164
165
results = await self .schlay .search (
165
166
query = 'PART01' , project_ids = [self .project_id ]
@@ -197,7 +198,7 @@ async def test_search_mixed(self):
197
198
fptable = FamilyParticipantTable (self .connection )
198
199
199
200
p = await self .player .upsert_participant (
200
- ParticipantUpsertInternal (external_id = 'X:PART01' )
201
+ ParticipantUpsertInternal (external_ids = { PRIMARY_EXTERNAL_ORG : 'X:PART01' } )
201
202
)
202
203
f_id = await self .flayer .create_family (external_id = 'X:FAM01' )
203
204
await fptable .create_rows (
@@ -216,7 +217,7 @@ async def test_search_mixed(self):
216
217
217
218
sample = await self .slayer .upsert_sample (
218
219
SampleUpsertInternal (
219
- external_id = 'X:SAM001' ,
220
+ external_ids = { PRIMARY_EXTERNAL_ORG : 'X:SAM001' } ,
220
221
type = 'blood' ,
221
222
participant_id = p .id ,
222
223
)
0 commit comments