コード例 #1
0
def test_owe_1T1():
    books = [0, 1]
    assert cash_register(books) == 8
コード例 #2
0
def test_owe_1T1_2T2_2T3_1T4():
    books = [1, 2, 2, 1]
    assert_equals(cash_register(books), 4 * 8 * 0.8 + 2 * 8 * 0.95)
コード例 #3
0
def final_test():
    assert_equals(cash_register([2, 2, 2, 1, 1]), 51.20)
コード例 #4
0
def test_owe_1T1_2T2_2T3():
    books = [1, 2, 2]
    assert_equals(cash_register(books), 3 * 8 * 0.9 + 2 * 8 * 0.95)
コード例 #5
0
def test_owe_1T1_1T2_1T3():
    books = [1, 1, 1]
    assert_equals(cash_register(books), 3 * 8 * 0.9)
コード例 #6
0
def test_owe_2T1_and_1T2():
    books = [2, 1]
    assert_equals(cash_register(books), 2 * 8 * 0.95 + 8)
コード例 #7
0
def test_no_sales_means_no_money():
    books = [0, 0]
    assert cash_register(books) == 0
コード例 #8
0
def test_owe_2T1_give_no_discount():
    books = [2, 0]
    assert_equals(cash_register(books), 2 * 8)