def tests_for_solution1(): u"""Tests for task 1""" assert hw4_solution1.solution1("A") == {'a': 100.0} assert hw4_solution1.solution1("ABCda") == {'a': 40.0, 'b': 20.0, 'c': 20.0, 'd': 20.0} assert hw4_solution1.solution1("AsBCda") == {'a': 33.3, 'b': 16.7, 'c': 16.7, 'd': 16.7, 's': 16.7} assert hw4_solution1.solution1("q TyU#!{}.") == {'q': 25.0, 't': 25.0, 'y': 25.0, 'u': 25.0} assert sum(hw4_solution1.solution1("q TyU#!{}.").values()) == 100.0
def starter(): print "------- TASK #1 -------" print INPUT print " >> " print hw4_solution1.solution1("INPUT") print "------- TASK #2 -------" print INPUT print " >> " print hw4_solution2.solution2(INPUT, 34)
def tests_for_solution1(): u"""Tests for task 1""" assert hw4_solution1.solution1("A") == {'a': 100.0} assert hw4_solution1.solution1("ABCda") == { 'a': 40.0, 'b': 20.0, 'c': 20.0, 'd': 20.0 } assert hw4_solution1.solution1("AsBCda") == { 'a': 33.3, 'b': 16.7, 'c': 16.7, 'd': 16.7, 's': 16.7 } assert hw4_solution1.solution1("q TyU#!{}.") == { 'q': 25.0, 't': 25.0, 'y': 25.0, 'u': 25.0 } assert sum(hw4_solution1.solution1("q TyU#!{}.").values()) == 100.0