예제 #1
0
def test_roundoff():
    '''Test that roundoff works.'''
    assert to_celsius(100) == 38 # NOT 37.777...
예제 #2
0
def test_to_celsius():
    '''Test function for to_celsius'''
    assert to_celsius(100) == 37.8
예제 #3
0
def test_freezing():
    '''Test freezing point.'''
    assert to_celsius(32) == 0
예제 #4
0
def test_boiling():
    '''Test boiling point.'''
    assert to_celsius(212) == 100
예제 #5
0
def test_to_celsius():
    '''Test function for to_celsius'''
    assert to_celsius(100) == 37.8, 'Returning an unrounded result'
예제 #6
0
    return math.sqrt((x1 - x0) ** 2 + (y1 - y0) ** 2)

 



 
F
======================================================================
FAIL: Test function for to_celsius
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/python25/lib/site-packages/nose/case.py", line 202, in runTest
    self.test(*self.arg)
  File "assert2.py", line 6, in test_to_celsius
    assert to_celsius(100) == 37.8
AssertionError
----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (failures=1)

 

 
F
======================================================================
FAIL: Test function for to_celsius
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\Python25\Lib\site-packages\nose\case.py", line 202, in runTest
예제 #7
0
파일: assert.py 프로젝트: kimihito/introcs
def test_boiling():
  '''沸点のテスト'''
  assert to_celsius(212) == 100
def test_roundoff():
    ''' 四捨五入のテスト '''
    assert to_celsius(100) == 38 # 37.777...ではなく
예제 #9
0
파일: assert.py 프로젝트: kimihito/introcs
def test_roundoff():
  '''四捨五入のテスト'''
  assert to_celsius(100) == 38
예제 #10
0
파일: assert.py 프로젝트: kimihito/introcs
def test_freezing():
  '''氷点のテスト'''
  assert to_celsius(32) == 0
예제 #11
0
def test_boiling():
    '''Test boiling point.'''
    assert to_celsius(212) == 100
예제 #12
0
def test_freezing():
    '''Test freezing point.'''
    assert to_celsius(32) == 0
예제 #13
0
def test_roundoff():
    '''Test that roundoff works.'''
    assert to_celsius(100) == 38 # NOT 37.777...
예제 #14
0
def test_to_celsius():
    '''Test function for to_celsius'''
    assert to_celsius(100) == 37.8, 'Returning an unrounded result'
예제 #15
0
파일: assert3.py 프로젝트: kimihito/introcs
def test_to_celsius():
  '''to_celsiusのテスト関数'''
  assert to_celsius(100) == 37.8, '四捨五入されていない結果'
예제 #16
0
파일: assert2.py 프로젝트: kimihito/introcs
def test_to_celsius():
  '''to_celsiusのテスト関数'''
  assert to_celsius(100) == 37.8
예제 #17
0
def test_to_celsius():
    '''Test function for to_celsius'''
    assert to_celsius(100) == 37.8