@@ -72,7 +72,7 @@ def setup(self, database_mock):
72
72
73
73
# Here we only wrap the utils so they keep their original functionality - this is done here
74
74
# to avoid having to mock the code generation function as the output will be passed to
75
- # CatalogueCategoryOut with pydantic validation and so will error otherwise
75
+ # ` CatalogueCategoryOut` with pydantic validation and so will error otherwise
76
76
with patch ("inventory_management_system_api.repositories.catalogue_category.utils" ) as mock_utils :
77
77
self .mock_utils = mock_utils
78
78
yield
@@ -97,7 +97,7 @@ def check_has_child_elements_performed_expected_calls(self, expected_catalogue_c
97
97
"""
98
98
Checks that a call to `has_child_elements` performed the expected function calls.
99
99
100
- :param expected_catalogue_category_id: Expected catalogue category id used in the database calls.
100
+ :param expected_catalogue_category_id: Expected `catalogue_category_id` used in the database calls.
101
101
"""
102
102
103
103
self .catalogue_categories_collection .find_one .assert_called_once_with (
@@ -137,7 +137,7 @@ def mock_create(
137
137
138
138
inserted_catalogue_category_id = CustomObjectId (str (ObjectId ()))
139
139
140
- # Pass through CatalogueCategoryIn first as need creation and modified times
140
+ # Pass through ` CatalogueCategoryIn` first as need creation and modified times
141
141
self ._catalogue_category_in = CatalogueCategoryIn (** catalogue_category_in_data )
142
142
143
143
self ._expected_catalogue_category_out = CatalogueCategoryOut (
@@ -177,7 +177,7 @@ def mock_create(
177
177
)
178
178
179
179
def call_create (self ) -> None :
180
- """Calls the CatalogueCategoryRepo `create` method with the appropriate data from a prior call to
180
+ """Calls the ` CatalogueCategoryRepo` `create` method with the appropriate data from a prior call to
181
181
`mock_create`"""
182
182
183
183
self ._created_catalogue_category = self .catalogue_category_repository .create (
@@ -186,7 +186,7 @@ def call_create(self) -> None:
186
186
187
187
def call_create_expecting_error (self , error_type : type [BaseException ]) -> None :
188
188
"""
189
- Calls the CatalogueCategoryRepo `create` method with the appropriate data from a prior call to `mock_create`
189
+ Calls the ` CatalogueCategoryRepo` `create` method with the appropriate data from a prior call to `mock_create`
190
190
while expecting an error to be raised
191
191
192
192
:param error_type: Expected exception to be raised.
@@ -280,7 +280,7 @@ def test_create_with_parent(self):
280
280
self .check_create_success ()
281
281
282
282
def test_create_with_non_existent_parent_id (self ):
283
- """Test creating a catalogue category with a non existent parent_id."""
283
+ """Test creating a catalogue category with a non- existent ` parent_id` ."""
284
284
285
285
parent_id = str (ObjectId ())
286
286
@@ -490,7 +490,7 @@ def mock_list(self, catalogue_categories_in_data: list[dict]) -> None:
490
490
"""Mocks database methods appropriately to test the `list` repo method
491
491
492
492
:param catalogue_categories_in_data: List of dictionaries containing the catalogue category data as would be
493
- required for a `CatalogueCategoryIn` database model (i.e. no id or created
493
+ required for a `CatalogueCategoryIn` database model (i.e. no ID or created
494
494
and modified times required)
495
495
"""
496
496
@@ -508,7 +508,7 @@ def mock_list(self, catalogue_categories_in_data: list[dict]) -> None:
508
508
509
509
def call_list (self , parent_id : Optional [str ]) -> None :
510
510
"""
511
- Calls the CatalogueCategoryRepo `list` method.
511
+ Calls the ` CatalogueCategoryRepo` `list` method.
512
512
513
513
:param parent_id: ID of the parent catalogue category to query by, or `None`.
514
514
"""
@@ -534,7 +534,7 @@ class TestList(ListDSL):
534
534
"""Tests for listing Catalogue Category's."""
535
535
536
536
def test_list (self ):
537
- """Test listing all Catalogue Categories ."""
537
+ """Test listing all catalogue categories ."""
538
538
539
539
self .mock_list (
540
540
[
@@ -546,7 +546,7 @@ def test_list(self):
546
546
self .check_list_success ()
547
547
548
548
def test_list_with_parent_id_filter (self ):
549
- """Test listing all Catalogue Categories with a given parent_id."""
549
+ """Test listing all catalogue categories with a given ` parent_id` ."""
550
550
551
551
self .mock_list (
552
552
[
@@ -558,7 +558,7 @@ def test_list_with_parent_id_filter(self):
558
558
self .check_list_success ()
559
559
560
560
def test_list_with_null_parent_id_filter (self ):
561
- """Test listing all Catalogue Categories with a 'null' parent_id."""
561
+ """Test listing all catalogue categories with a 'null' parent_id."""
562
562
563
563
self .mock_list (
564
564
[
@@ -570,7 +570,7 @@ def test_list_with_null_parent_id_filter(self):
570
570
self .check_list_success ()
571
571
572
572
def test_list_with_parent_id_with_no_results (self ):
573
- """Test listing all Catalogue Categories with a `parent_id` filter returning no results."""
573
+ """Test listing all catalogue categories with a `parent_id` filter returning no results."""
574
574
575
575
self .mock_list ([])
576
576
self .call_list (parent_id = str (ObjectId ()))
@@ -625,7 +625,7 @@ def mock_update(
625
625
:param duplicate_catalogue_category_in_data: Either `None` or a dictionary containing the data for a duplicate
626
626
catalogue category as would be required for a `CatalogueCategoryIn`
627
627
database model.
628
- :param valid_move_result: Whether to mock in a valid or invalid move result i.e. when True will simulating
628
+ :param valid_move_result: Whether to mock in a valid or invalid move result i.e. when ` True` will simulate
629
629
moving the catalogue category to one of its own children.
630
630
"""
631
631
self .set_update_data (new_catalogue_category_in_data )
@@ -700,7 +700,7 @@ def mock_update(
700
700
701
701
def call_update (self , catalogue_category_id : str ) -> None :
702
702
"""
703
- Calls the CatalogueCategoryRepo `update` method with the appropriate data from a prior call to `mock_update`
703
+ Calls the ` CatalogueCategoryRepo` `update` method with the appropriate data from a prior call to `mock_update`
704
704
(or`set_update_data`).
705
705
706
706
:param catalogue_category_id: ID of the catalogue category to be updated.
@@ -713,7 +713,7 @@ def call_update(self, catalogue_category_id: str) -> None:
713
713
714
714
def call_update_expecting_error (self , catalogue_category_id : str , error_type : type [BaseException ]) -> None :
715
715
"""
716
- Calls the CatalogueCategoryRepo `update` method with the appropriate data from a prior call to `mock_update`
716
+ Calls the ` CatalogueCategoryRepo` `update` method with the appropriate data from a prior call to `mock_update`
717
717
(or `set_update_data`) while expecting an error to be raised.
718
718
719
719
:param catalogue_category_id: ID of the catalogue category to be updated.
@@ -1024,7 +1024,7 @@ def call_delete(self, catalogue_category_id: str) -> None:
1024
1024
1025
1025
def call_delete_expecting_error (self , catalogue_category_id : str , error_type : type [BaseException ]) -> None :
1026
1026
"""
1027
- Calls the CatalogueCategoryRepo `delete` method while expecting an error to be raised.
1027
+ Calls the ` CatalogueCategoryRepo` `delete` method while expecting an error to be raised.
1028
1028
1029
1029
:param catalogue_category_id: ID of the catalogue category to be deleted.
1030
1030
:param error_type: Expected exception to be raised.
0 commit comments