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)
Example #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)
Example #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          
Example #4
0
def test_add():
    assert 2 == add(1, 1)
Example #5
0
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()
Example #6
0
def test_add():
    assert add(4, 4) == 8
Example #7
0
 def test_add(self):
     self.assertEqual(add(3, 4), 7)
Example #8
0
 def test_add2(self):
     self.assertEqual(30, hello.add(10, 20))
Example #9
0
 def test_add(self):
     self.assertEqual(hello.add(2, 4), 6)
Example #10
0
def test_add_strings():
    result = hello.add('hello ', 'world')
    assert result == 'hello world'
    assert type(result) is str
    assert 'hello' in result
Example #11
0
import hello

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

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

import hello

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

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

import hello

hello.add(7,8)
Example #22
0
def test_add():
    assert hello.add(1,2) == 3
Example #23
0
def test_add():
    assert 5 + 5 == hello.add(5, 5)
Example #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
Example #25
0
def test_add():
	assert add(2,3)==3
Example #26
0
def test_hello_add():
    assert add(test_hello_add.x) == 11
Example #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)
Example #29
0
def test_add():
    assert 3 == add(1, 2)