Exemplo n.º 1
0
 def get_furniture(furniture_type):
     try:
         if furniture_type in {"BigChair", "MediumChair", "SmallChair"}:
             return ChairFactory.get_chair(furniture_type)
         elif furniture_type in {"BigTable", "MediumTable", "SmallTable"}:
             return TableFactory.get_table(furniture_type)
         else:
             raise AssertionError("Furniture not found")
     except AssertionError as _e:
         print(_e)
     return None
Exemplo n.º 2
0
    def get_furniture(furniture_type):
        try:

            if furniture_type in ["BigChair","MediumChair","SmallChair"]:
                return ChairFactory.get_chair(furniture_type)
            if furniture_type in ["SmallTable","MediumTable","BigTable"]:
                return TableFactory.get_Table(furniture_type)

            raise AssertionError("Cannot find furniture type")

        except AssertionError as _e:
            print(_e)
        return None