def test_add(self):
     # For this test case, I will have two asserts
     #   if one fails, then all the test case fails.
     self.assertEqual(hello.add(3,5),8)
     # This second assert will fail,
     #   because I'm saying that the resukt will be 3 when the result is 15
     #   if we change the value to 15, then it will pass
     self.assertEqual(hello.add(10,5),3)
示例#2
0
def f():
    """ calls hello
    """
    s = hello.add(7, 2)

    logging.debug("logging sum from caller.py:" + s)
    print("printing sum from caller.py:" + s)
示例#3
0
def f(): 
    ''' calls hello
    '''
    s=hello.add(7,2)          

    logging.debug('logging sum from caller.py:' + s)
    print 'printing sum from caller.py:', s          
示例#4
0
def test_add():
    assert 2 == add(1, 1)
示例#5
0
文件: test2.py 项目: lingmaoer/python
import hello

a = hello.add(30, 40)
# add(100,200)      #不加模块名无法识别
print(a)

from hello import *

a = add(100, 200)  #无需模块名,可以直接引用里面的函数/类
print(a)

b = MyNum()
b.print123()
示例#6
0
def test_add():
    assert add(4, 4) == 8
示例#7
0
 def test_add(self):
     self.assertEqual(add(3, 4), 7)
示例#8
0
 def test_add2(self):
     self.assertEqual(30, hello.add(10, 20))
示例#9
0
 def test_add(self):
     self.assertEqual(hello.add(2, 4), 6)
示例#10
0
def test_add_strings():
    result = hello.add('hello ', 'world')
    assert result == 'hello world'
    assert type(result) is str
    assert 'hello' in result
示例#11
0
import hello

print("hi")
print(hello.add(3))
示例#12
0
from hello import add

print(add(1, 1))
示例#13
0
def test_add():
    assert add(10, 15) == 25
示例#14
0
#!/usr/bin/env python3

import hello

print(hello.add(1, 2))
示例#15
0
def test_add():

    assert add(1, 2) == 3
示例#16
0
def test_hello_add():
    assert add(1, 2) == 3
示例#17
0
文件: pytest.py 项目: jha8/grpc
def test_add():
    a = 1
    b = 2
    c = 3
    d = hello.add(c, a)
    assert d == -1
示例#18
0
def test_add():
    assert hello.add(3, 8) == 11
    assert hello.add(6) == 8
示例#19
0
def test_add():
    assert add(1, 3) == 4
    assert add(2, 3) == 5
示例#20
0
 def test_add(self):
     self.assertEqual(5, hello.add(2, 3))
示例#21
0
文件: index.py 项目: AC740/Py

import hello

hello.add(7,8)
示例#22
0
def test_add():
    assert hello.add(1,2) == 3
示例#23
0
def test_add():
    assert 5 + 5 == hello.add(5, 5)
示例#24
0
from hello import add

assert add(0, 0) == 0
assert add(12, 12) == 24
assert add(-12, 12) == 0
assert add(12, -2) == 10
assert add(-12, -2) == -14
示例#25
0
def test_add():
	assert add(2,3)==3
示例#26
0
def test_hello_add():
    assert add(test_hello_add.x) == 11
示例#27
0
def test_add():
    assert add(1, 2) == 3
    assert add(3, 2) == 5
    assert add(0, 0) == 0
def test_add():
    assert 9 == add(4, 5)
示例#29
0
def test_add():
    assert 3 == add(1, 2)