Пример #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
def test_boiling():
  '''沸点のテスト'''
  assert to_celsius(212) == 100
def test_roundoff():
    ''' 四捨五入のテスト '''
    assert to_celsius(100) == 38 # 37.777...ではなく
Пример #9
0
def test_roundoff():
  '''四捨五入のテスト'''
  assert to_celsius(100) == 38
Пример #10
0
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
def test_to_celsius():
  '''to_celsiusのテスト関数'''
  assert to_celsius(100) == 37.8, '四捨五入されていない結果'
Пример #16
0
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