Skip to content

Commit

Permalink
Added pylint disable for duplicate code - ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
cisc0f committed Mar 23, 2024
1 parent faa7db8 commit c33d022
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions service/models/shop_cart.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def deserialize(self, data):
item = ShopCartItem()
item.deserialize(json_item)
self.items.append(item)
# pylint: disable=duplicate-code
except AttributeError as error:
raise DataValidationError("Invalid attribute: " + error.args[0]) from error
except KeyError as error:
Expand Down
1 change: 1 addition & 0 deletions service/models/shop_cart_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def deserialize(self, data):
self.product_id = data["product_id"]
self.quantity = data["quantity"]
self.price = data["price"]
# pylint: disable=duplicate-code
except AttributeError as error:
raise DataValidationError("Invalid attribute: " + error.args[0]) from error
except KeyError as error:
Expand Down
1 change: 1 addition & 0 deletions tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class TestShopCartService(TestCase):
"""REST API Server Tests"""

# pylint: disable=duplicate-code
@classmethod
def setUpClass(cls):
"""Run once before all tests"""
Expand Down
1 change: 1 addition & 0 deletions tests/test_shop_cart_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
class TestShopCartItem(TestCase):
"""Shop Cart Item Model CRUD Tests"""

# pylint: disable=duplicate-code
@classmethod
def setUpClass(cls):
"""This runs once before the entire test suite"""
Expand Down

0 comments on commit c33d022

Please sign in to comment.