File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed
tests/time_tracker_api/activities
time_tracker_api/activities Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 1616)
1717def test_find_all_with_id_in_list (
1818 find_partition_key_value_mock ,
19- create_sql_condition_for_visibility_mock ,
2019 event_context : EventContext ,
2120 activity_repository : ActivityCosmosDBRepository ,
2221):
@@ -31,9 +30,10 @@ def test_find_all_with_id_in_list(
3130 activity_repository .container = Mock ()
3231 activity_repository .container .query_items = query_items_mock
3332
34- result = activity_repository .find_all_with_id_in_list (event_context , [expected_item ])
33+ result = activity_repository .find_all_with_id_in_list (
34+ event_context , [expected_item ]
35+ )
3536
36- create_sql_condition_for_visibility_mock .assert_called_once ()
3737 find_partition_key_value_mock .assert_called_once ()
3838 query_items_mock .assert_called_once ()
3939
Original file line number Diff line number Diff line change @@ -67,15 +67,13 @@ def find_all_with_id_in_list(
6767 visible_only = True ,
6868 mapper : Callable = None ,
6969 ):
70- visibility = self .create_sql_condition_for_visibility (visible_only )
71- query_str = """
72- SELECT * FROM c
73- WHERE {condition}
74- {visibility_condition}
75- """ .format (
76- condition = create_sql_in_condition ("id" , activity_ids ),
77- visibility_condition = visibility ,
70+ query_builder = (
71+ CosmosDBQueryBuilder ()
72+ .add_sql_in_condition ('id' , activity_ids )
73+ .add_sql_visibility_condition (visible_only )
74+ .build ()
7875 )
76+ query_str = query_builder .get_query ()
7977
8078 tenant_id_value = self .find_partition_key_value (event_context )
8179 result = self .container .query_items (
You can’t perform that action at this time.
0 commit comments