Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

12 tests.py #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 13 additions & 4 deletions homework/tests.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import math


def test_even_fucntion():
"""
Необходимо реализовать функцию even_filter, которая получает неограниченное количество аргументов
и возвращает из них только четные.
"""

def even_filter(*args):
pass
even = [x for x in args if x % 2 == 0]
return even

assert even_filter(1, 2, 3, 4, 5, 6) == [2, 4, 6]

Expand All @@ -16,7 +20,10 @@ def test_increment_decorator():
декрорируемую функцию.
"""
def increment_derocator(func):
pass
def wrap(arg1):
arg2 = arg1 + 1
return func(arg2)
return wrap

@increment_derocator
def returner(value):
Expand All @@ -41,10 +48,12 @@ def __init__(self, x, y):

class Segment():
def __init__(self, p1, p2):
pass
self.p1 = p1
self.p2 = p2

def length(self):
return 0
dist = math.hypot(self.p2.x - self.p1.x, self.p2.y - self.p1.y)
return dist

p1 = Point(0, 0)
p2 = Point(3, 4)
Expand Down