Source

PythonDojo / BowlingWithAVengeance / test.py

Full commit
from nose.tools import assert_equal

import bowling

def test_parse_strike():
    assert_equal(bowling.parse_roll("X"),bowling.STRIKE)
    
def test_parse_spare():
    assert_equal(bowling.parse_roll("/"),bowling.SPARE)
    
def test_simple_frame():
    assert_equal(bowling.frame_score((3,2)), 5)
    
def test_simple_frame_2():
    assert_equal(bowling.frame_score((9,0)), 9)
    
def test_strike():
    assert_equal(bowling.frame_score((10,)), 10)
    
def test_get_score():
    assert_equal(bowling.get_score(((3,2), (4,5))), 14)