Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@
}
collection_of_coins = {1, 2, 25}

# write your code here
sorted_variables = {
"mutable": [my_favourite_films, marks, collection_of_coins],
"immutable": [lucky_number, pi, one_is_a_prime_number, name, profile_info],
}
14 changes: 6 additions & 8 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def test_variables_values(variable, value):
def test_variables_should_be_added_to_sorted_variables(variable_name):
sorted_variables = getattr(app.main, "sorted_variables")
assert (
getattr(app.main, variable_name) in sorted_variables["mutable"] or
getattr(app.main, variable_name) in sorted_variables["immutable"]
getattr(app.main, variable_name) in sorted_variables["mutable"]
or getattr(app.main, variable_name) in sorted_variables["immutable"]
), f"Variable '{variable_name}' should be added to 'sorted_variables'"


Expand All @@ -82,14 +82,12 @@ def is_immutable(obj):
def test_variables_added_to_the_correct_list():
sorted_variables = getattr(app.main, "sorted_variables")
for variable in sorted_variables["mutable"]:
assert is_immutable(variable) is False, (
f"{variable} should be in 'immutable' list"
)
assert (
is_immutable(variable) is False
), f"{variable} should be in 'immutable' list"

for variable in sorted_variables["immutable"]:
assert is_immutable(variable) is True, (
f"{variable} should be in 'mutable' list"
)
assert is_immutable(variable) is True, f"{variable} should be in 'mutable' list"


def test_removed_comment():
Expand Down
Loading