Beispiel #1
0
 def _check_input(self, colour: Colours, size: Size, stuffing: Stuffing,
                  fabric: Fabric, name: str, description: str,
                  product_id: str) -> None:
     CheckInput.check_type(colour, Colours)
     CheckInput.check_type(stuffing, Stuffing)
     CheckInput.check_type(fabric, Fabric)
     CheckInput.check_type(size, Size)
     CheckInput.check_all_input_type([name, description, product_id], str)
Beispiel #2
0
 def _check_input(self, size: Size, stuffing: Stuffing, fabric: Fabric,
                  has_glow: bool, name: str, description: str,
                  product_id: str) -> None:
     CheckInput.check_type(size, Size)
     CheckInput.check_type(stuffing, Stuffing)
     CheckInput.check_type(fabric, Fabric)
     CheckInput.check_type(has_glow, bool)
     CheckInput.check_all_input_type([name, description, product_id], str)
Beispiel #3
0
 def _check_input(self, sound_effects_number: int, colour: Colours,
                  has_batteries: bool, name: str, description: str,
                  product_id: str) -> None:
     CheckInput.check_type(sound_effects_number, int)
     CheckInput.check_type(colour, Colours)
     CheckInput.check_type(has_batteries, bool)
     CheckInput.check_all_input_type([name, description, product_id], str)
     CheckInput.check_value_is_lower_equal_than_threshold(
         sound_effects_number, 0)
Beispiel #4
0
 def _check_input(self, rooms_number: int, dimensions: float, min_age: int,
                  has_batteries: bool, name: str, description: str,
                  product_id: str) -> None:
     """
     Checks input.
     """
     CheckInput.check_all_input_type([rooms_number, min_age], int)
     CheckInput.check_type(dimensions, int, float)
     CheckInput.check_type(has_batteries, bool)
     CheckInput.check_all_input_value_is_lower_equal_than_threshold(
         [rooms_number, dimensions, min_age], 0)
     CheckInput.check_all_input_type([description, product_id, name], str)
Beispiel #5
0
 def _check_input_type(
         order_number: int,
         product_id: str,
         name: str,
         quantity: int,
         item_type: InventoryEnum,
         product_details: dict,
         factory: FestiveSeasonFactory) -> None:
     """
     Checks if all inputs are valid.
     """
     CheckInput.check_all_input_type([product_id, name], str)
     CheckInput.check_all_input_type([order_number, quantity], int)
     CheckInput.check_type(item_type, InventoryEnum)
     CheckInput.check_type(product_details, dict)
     CheckInput.check_type(factory, FestiveSeasonFactory)
Beispiel #6
0
 def _check_input(self, speed: float, jump_height: float,
                  is_grow_in_dark: bool, spider_type: SpiderType,
                  min_age: int, has_batteries: bool, name: str,
                  description: str, product_id: str) -> None:
     """
     Checks input.
     """
     CheckInput.check_all_input_type([speed, jump_height, min_age], int,
                                     float)
     CheckInput.check_type(spider_type, SpiderType)
     CheckInput.check_all_input_type([is_grow_in_dark, has_batteries], bool)
     CheckInput.check_all_input_type([name, description, product_id], str)
     CheckInput.check_all_input_value_is_lower_equal_than_threshold(
         [speed, jump_height, min_age], 0)
 def _check_input(self, contains_nuts: bool, variety: ToffeeVariety,
                  has_lactose: bool, name: str, description: str,
                  product_id: str) -> None:
     CheckInput.check_all_input_type([contains_nuts, has_lactose], bool)
     CheckInput.check_type(variety, ToffeeVariety)
     CheckInput.check_all_input_type([name, description, product_id], str)
Beispiel #8
0
 def _check_input(self, has_nut: bool, has_lactose: bool, pack_size: int,
                  name: str, description: str, product_id: str) -> None:
     CheckInput.check_type(pack_size, int)
     CheckInput.check_value_is_lower_equal_than_threshold(pack_size, 0)
     CheckInput.check_all_input_type([has_nut, has_lactose], bool)
     CheckInput.check_all_input_type([name, description, product_id], str)
Beispiel #9
0
 def _check_input(self, stripes_colour, has_nuts: bool, has_lactose: bool,
                  name: str, description: str, product_id: str) -> None:
     CheckInput.check_type(stripes_colour, Colours)
     CheckInput.check_all_input_type([name, description, product_id], str)
     CheckInput.check_all_input_type([has_lactose, has_nuts], bool)