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

test1 #6

Open
wants to merge 5 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
18 changes: 14 additions & 4 deletions homework/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ def test_even_fucntion():
"""

def even_filter(*args):
pass
result = []

for i in args:
if i % 2 == 0:
result.append(i)
return result

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


Expand All @@ -16,14 +21,17 @@ def test_increment_decorator():
декрорируемую функцию.
"""
def increment_derocator(func):
pass
def wrapper(value):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тоже знаки +, и не хватает сдвига внутренней функции вправо, т.к. она определяется в теле функции increment_derocator.

return func(value + 1)
return wrapper

@increment_derocator
def returner(value):
return value

assert returner(1) == 2

import math

def test_point_segment_class():
"""
Expand All @@ -41,10 +49,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
value = math.sqrt(math.pow(self.p1.x - self.p2.x, 2) + math.pow(self.p1.y - self.p2.y, 2))
return value

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