Esempio n. 1
0
def test_roundoff():
    '''Test that roundoff works.'''
    assert to_celsius(100) == 38 # NOT 37.777...
Esempio n. 2
0
def test_to_celsius():
    '''Test function for to_celsius'''
    assert to_celsius(100) == 37.8
Esempio n. 3
0
def test_freezing():
    '''Test freezing point.'''
    assert to_celsius(32) == 0
Esempio n. 4
0
def test_boiling():
    '''Test boiling point.'''
    assert to_celsius(212) == 100
Esempio n. 5
0
def test_to_celsius():
    '''Test function for to_celsius'''
    assert to_celsius(100) == 37.8, 'Returning an unrounded result'
Esempio n. 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
Esempio n. 7
0
def test_boiling():
  '''沸点のテスト'''
  assert to_celsius(212) == 100
def test_roundoff():
    ''' 四捨五入のテスト '''
    assert to_celsius(100) == 38 # 37.777...ではなく
Esempio n. 9
0
def test_roundoff():
  '''四捨五入のテスト'''
  assert to_celsius(100) == 38
Esempio n. 10
0
def test_freezing():
  '''氷点のテスト'''
  assert to_celsius(32) == 0
Esempio n. 11
0
def test_boiling():
    '''Test boiling point.'''
    assert to_celsius(212) == 100
Esempio n. 12
0
def test_freezing():
    '''Test freezing point.'''
    assert to_celsius(32) == 0
Esempio n. 13
0
def test_roundoff():
    '''Test that roundoff works.'''
    assert to_celsius(100) == 38 # NOT 37.777...
Esempio n. 14
0
def test_to_celsius():
    '''Test function for to_celsius'''
    assert to_celsius(100) == 37.8, 'Returning an unrounded result'
Esempio n. 15
0
def test_to_celsius():
  '''to_celsiusのテスト関数'''
  assert to_celsius(100) == 37.8, '四捨五入されていない結果'
Esempio n. 16
0
def test_to_celsius():
  '''to_celsiusのテスト関数'''
  assert to_celsius(100) == 37.8
Esempio n. 17
0
def test_to_celsius():
    '''Test function for to_celsius'''
    assert to_celsius(100) == 37.8