def test_count(): case1 = "aabbabb" case2 = "ccaabb" case3 = "jllkd" case4 = "nbmmbn" eq_(count(case1), "YES") eq_(count(case2), "YES") eq_(count(case3), "NO") eq_(count(case4), "YES")
def test_7(self): r = 5 c = 1 k = 3 expected = 3 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_8(self): r = 3 c = 4 k = 5 expected = 0 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_9(self): r = 12 c = 10 k = 8 expected = 116 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_10(self): r = 97 c = 83 k = 5 expected = 30076 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_1(self): r = 3 c = 3 k = 3 expected = 8 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_2(self): r = 3 c = 3 k = 2 expected = 20 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_3(self): r = 3 c = 4 k = 1 expected = 12 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_4(self): r = 1 c = 5 k = 5 expected = 1 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_5(self): r = 1 c = 5 k = 3 expected = 3 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_6(self): r = 5 c = 1 k = 5 expected = 1 answer = main.count(r, c, k) self.assertEqual(answer, expected)
def test_count(self): for reprints, units, expected in [ (1, 10000, 5), (2, 10000, 8), ]: self.assertEqual( expected, main.count(reprints, units), '{}, {}'.format(reprints, units) )
def test_main(): """test for main function""" case1 = 12 case2 = 6 case3 = 10 case4 = 20 case5 = 3 case6 = 2 case7 = 11 eq_(main.count(case1), 36) eq_(main.count(case2), 9) eq_(main.count(case3), 25) eq_(main.count(case4), 100) eq_(main.count(case5), 2) eq_(main.count(case6), 1) eq_(main.count(case7), 30)
def test_main(): """test for main function""" case1 = [1, 2, 100, 0] case2 = [3, 5, 6, 0] case3 = [1, 10, 6, 0] case4 = [3, 6, 60, 0] case5 = [1, 2, 145, 0] case6 = [1, 2, 2, 0] case7 = [4, 6, 5, 0] eq_(main.count(case1[0], case1[1], case1[2], case1[3]), 200) eq_(main.count(case2[0], case2[1], case2[2], case2[3]), 18) eq_(main.count(case3[0], case3[1], case3[2], case3[3]), 60) eq_(main.count(case4[0], case4[1], case4[2], case4[3]), 240) eq_(main.count(case5[0], case5[1], case5[2], case5[3]), 290) eq_(main.count(case6[0], case6[1], case6[2], case6[3]), 4) eq_(main.count(case7[0], case7[1], case7[2], case7[3]), 15)
def test_main(): """test for main function""" case1 = [12, 4, 4] case2 = [6, 2, 2] case3 = [10, 5, 6] case4 = [20, 1, 2] case5 = [1, 10, 1] case6 = [2, 2, 2] case7 = [10, 2, 5] eq_(main.count(case1[0], case1[1], case1[2]), 3) eq_(main.count(case2[0], case2[1], case2[2]), 5) eq_(main.count(case3[0], case3[1], case3[2]), 2) eq_(main.count(case4[0], case4[1], case4[2]), 39) eq_(main.count(case5[0], case5[1], case5[2]), 0) eq_(main.count(case6[0], case6[1], case6[2]), 1) eq_(main.count(case7[0], case7[1], case7[2]), 6)
def test_main(): """test for main function""" case1 = [4, 10, 100] case2 = [6, 2, 2] case3 = [10, 5, 6] case4 = [20, 1, 2] case5 = [1, 10, 1] case6 = [2, 2, 2] case7 = [10, 2, 5] eq_(main.count(case1[0], case1[1], case1[2]), [30, 120, 210, 300]) eq_(main.count(case2[0], case2[1], case2[2]), [10]) eq_(main.count(case3[0], case3[1], case3[2]), [45, 46, 47, 48, 49, 50, 51, 52, 53, 54]) eq_(main.count(case4[0], case4[1], case4[2]), [19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38]) eq_(main.count(case5[0], case5[1], case5[2]), [0]) eq_(main.count(case6[0], case6[1], case6[2]), [2]) eq_(main.count(case7[0], case7[1], case7[2]), [18, 21, 24, 27, 30, 33, 36, 39, 42, 45])
def test_count(): assert count("abc") == 3 assert count("a\nb\nc") == 3 assert count("a\na\na") == 1 assert count("ab\nac") == 3
def test_for_2(): number = 2 eq_(main.count(number), -1)
def test_for_7(): number = 7 eq_(main.count(number), -1)
def test_for_30(): number = 30 eq_(main.count(number), int('555' * 10))
def test_for_8(): number = 8 eq_(main.count(number), 55533333)
def test_for_3(): number = 3 eq_(main.count(number), 555)
def test_for_115(): number = 115 eq_(main.count(number), 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555553333333333)
def test2(self): self.assertEqual(main.count(''), {})
def test_for_5(): number = 5 eq_(main.count(number), 33333)
def test1(self): self.assertEqual(main.count('aba'), {'a': 2, 'b': 1})
def test_count(): assert count(rules(TEST)) == 4
import main #student solution to the hw import TA_main #ta's solution to the hw from session import Session #import the session object sess = Session(TA_main, main) # main_proxy = sess.get_module_proxy() basic_compare = sess.compare() if basic_compare: sess.score_key('basic_compare', 20) test_count = main.count(5) # test_count = main_proxy.count(5) TA_COUNT = TA_main.count(5) if test_count == TA_COUNT: sess.i_log('test_count(5)', "PASSED") sess.i_log('test_count(5)', "booyah") sess.score_key('testcount5', 5) sess.test_hw_function('count', [0, -5, 10], [-1, 2.5, 7]) # sqInt_test = main_proxy.SquareInt(4) # sqit = sqInt_test.square() else: sess.x_log("WHOOPS", "ERROR: your function/class names did not match up with those provided in the solution key. please look over your work and resubmit") final = sess.finalize()
def test_count(): series = count('hello my friend') expected = [5, 2, 6] assert list(series) == expected
def test_count(): assert count(TREES.split("\n"), 1, 3) == 7