Testing Class Material
This commit is contained in:
commit
05b1f6cdd5
85 changed files with 102796 additions and 0 deletions
8
hands_on/first/first.py
Normal file
8
hands_on/first/first.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
def times_3(x):
|
||||
""" Multiply x by 3.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
x : The item to multiply by 3.
|
||||
"""
|
||||
return x * 3
|
19
hands_on/first/test_first.py
Normal file
19
hands_on/first/test_first.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from first import times_3
|
||||
|
||||
|
||||
def test_times_3_integer():
|
||||
value = 7
|
||||
expected = 21
|
||||
|
||||
result = times_3(value)
|
||||
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_times_3_string():
|
||||
value = 'wow'
|
||||
expected = 'wowwowwow'
|
||||
|
||||
result = times_3(value)
|
||||
|
||||
assert result == expected
|
Loading…
Add table
Add a link
Reference in a new issue