def test_square_return_value_type_is_int(inputs):
    # When 
    subject = square(inputs)

    #Then

    assert isinstance(subject, int)
コード例 #2
0
def test_return(inputs):
	val = square(inputs)

	assert isinstance(val, int)
コード例 #3
0
def test_square(input_value):
    val = square(input_value)

    assert val == 25
コード例 #4
0
def test_square:
	subject = square(4)

	assert subject == 16
コード例 #5
0
def test_square_returns_correctly():
    # When
    subject = square(2)

    # then
    assert subject == 4
コード例 #6
0
import my_module


my_module.square("red")
my_module.circle("blue")
my_module.anyshape(8,"green")

コード例 #7
0
def test_square_gives_correct_value(input_value):
    #When
    subject = square(input_value)

    #Then
    assert subject == 16
コード例 #8
0
# -*- coding:utf8 -*-
import my_module
print(my_module.multi(3, 4))

print(my_module.square(1.414))
import my_module

print(dir())

for i in range(0, 100):
    string = " {0} squared is {1}, {0} cubed is {2} ".format(
        str(i), str(my_module.square(i)), str(my_module.cube(i)))
    string = string.center(160, '*')
    print(string)

#Look up Python Paths in order to look for Modules in non CWD places