Verified Commit 68e89cda authored by Julien Palard's avatar Julien Palard
Browse files

Restaurant menu: Don't crash if a menu has no name.

parent 3b9f738a
Pipeline #501709 passed with stages
in 1 minute and 20 seconds
...@@ -190,12 +190,14 @@ def check(): ...@@ -190,12 +190,14 @@ def check():
"I don't have all the `Dish` of the 2 `Menu`s" "I don't have all the `Dish` of the 2 `Menu`s"
) )
if menu_montue.name != "Monday & Tuesday": with student_code(prefix="While trying to get the name of a menu"):
menu_montue_name = menu_montue.name
if menu_montue_name != "Monday & Tuesday":
fail( fail(
"If I add 2 `Menu` items with the `+` operator, " "If I add 2 `Menu` items with the `+` operator, "
"I don't have the wanted name.", "I don't have the wanted name.",
"I expected to get `Monday & Tuesday`, but it's `{name!r}`".format( "I expected to get `Monday & Tuesday`, but it's `{name!r}`".format(
name=menu_montue.name name=menu_montue_name
), ),
) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment