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
Binary file added app/__pycache__/main.cpython-313-pytest-9.1.1.pyc
Binary file not shown.
Binary file added app/__pycache__/main.cpython-313.pyc
Binary file not shown.
19 changes: 18 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,35 @@
pi = 3.14
one_is_a_prime_number = False
name = "Richard"

my_favourite_films = [
"The Shawshank Redemption",
"The Lord of the Rings: The Return of the King",
"Pulp Fiction",
"The Good, the Bad and the Ugly",
"The Matrix",
]

profile_info = ("michel", "michel@gmail.com", "12345678")

marks = {
"John": 4,
"Sergio": 3,
}

collection_of_coins = {1, 2, 25}

# write your code here
sorted_variables = {
"immutable": [
lucky_number,
pi,
one_is_a_prime_number,
name,
profile_info,
],
"mutable": [
my_favourite_films,
marks,
collection_of_coins,
],
}
Binary file added tests/__pycache__/__init__.cpython-313.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
35 changes: 33 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
import pytest
import inspect

import app.main

# Оголошення змінних
lucky_number = 777
pi = 3.14
one_is_a_prime_number = False
name = "Richard"
my_favourite_films = [
"The Shawshank Redemption",
"The Lord of the Rings: The Return of the King",
"Pulp Fiction",
"The Good, the Bad and the Ugly",
"The Matrix",
]
profile_info = ("michel", "michel@gmail.com", "12345678")
marks = {"John": 4, "Sergio": 3}
collection_of_coins = {1, 2, 25}

# Формування словника
sorted_variables = {
"immutable": [
lucky_number,
pi,
one_is_a_prime_number,
name,
profile_info,
],
"mutable": [
my_favourite_films,
marks,
collection_of_coins,
],
}

# Тести
@pytest.mark.parametrize(
"variable_name",
[
Expand Down Expand Up @@ -95,4 +126,4 @@ def test_variables_added_to_the_correct_list():
def test_removed_comment():
with open(app.main.__file__, "r") as f:
lines = inspect.getsource(app.main)
assert "# write your code here" not in lines
assert "# write your code here" not in lines
Loading