コード例 #1
0
 def test_count_substrings(self):
     self.assertEqual(
         2, solution.count_substrings("This is a test string", "is"))
     self.assertEqual(
         4,
         solution.count_substrings(
             "Python is an awesome language to program in!", "o"))
コード例 #2
0
ファイル: test.py プロジェクト: gshopov/the-stash
 def test_with_longer_strings(self):
     self.assertEqual(solution.count_substrings('either kill or be killed',
                                                'kill'),
                      2)
     self.assertEqual(solution.count_substrings("a beard doesn't make one" +
                                                " a philosopher",
                                                "yeaaap"),
                      0)
コード例 #3
0
 def test_count_substrings(self):
     self.assertEqual(count_substrings("This is a test string", "is"), 2)
     self.assertEqual(count_substrings("babababa", "baba"), 2)
     self.assertEqual(
         count_substrings("Python is an awesome language to program in!",
                          "o"), 4)
     self.assertEqual(
         count_substrings("We have nothing in common!", "really?"), 0)
     self.assertEqual(
         count_substrings("This is this and that is this ", "this"), 2)
コード例 #4
0
ファイル: tests.py プロジェクト: EmilianStankov/HackBulgaria
 def test_problem_statement_cases(self):
     self.assertEqual(2, count_substrings("This is a test string", "is"))
     self.assertEqual(2, count_substrings("babababa", "baba"))
     self.assertEqual(
         4,
         count_substrings("Python is an awesome language to program in!",
                          "o"))
     self.assertEqual(
         0, count_substrings("We have nothing in common!", "really?"))
     self.assertEqual(
         2, count_substrings("This is this and that is this", "this"))
コード例 #5
0
ファイル: test.py プロジェクト: fyllmax/Programming101
 def test_count_substrings(self):
     self.assertEqual(2, count_substrings("This is a test string", "is"))
 # 2
     self.assertEqual(2, count_substrings("babababa", "baba"))
     # 2
     self.assertEqual(
         4, count_substrings("Python is an awesome language to program in!", "o"))
     # 4
     self.assertEqual(
         0, count_substrings("We have nothing in common!", "really?"))
     # 0
     self.assertEqual(
         2, count_substrings("This is this and that is this", "this"))
コード例 #6
0
 def test_contains_digit(self):
     self.assertEqual(
         2, solution.count_substrings("This is a test string", "is"))
     self.assertEqual(2, solution.count_substrings("babababa", "baba"))
     self.assertEqual(
         4,
         solution.count_substrings(
             "Python is an awesome language to program in!", "o"))
     self.assertEqual(
         1,
         solution.count_substrings(
             "Python is an awesome language to program in!", "prog"))
     self.assertEqual(
         23,
         solution.count_substrings("Pyth,,,,,,,,,,,,,,,,,,,,,,,rogram in!",
                                   ","))
コード例 #7
0
 def test_three(self):
     self.assertEqual(4, count_substrings("Python is an awesome language to program in!", "o"))
コード例 #8
0
ファイル: test.py プロジェクト: miAndreev/Programming101-2
 def test_two(self):
     self.assertEquals(2, count_substrings("babababa", "baba"))
コード例 #9
0
ファイル: test.py プロジェクト: miAndreev/Programming101-2
 def test_five(self):
     self.assertEquals(
         2, count_substrings("This is this and that is this", "this"))
コード例 #10
0
ファイル: test.py プロジェクト: miAndreev/Programming101-2
 def test_tree(self):
     self.assertEquals(
         4,
         count_substrings("Python is an awesome language to program in!",
                          "o"))
コード例 #11
0
 def test_does_not_contains_string(self):
     self.assertFalse(solution.count_substrings("We have nothing in common!", "really?"))
コード例 #12
0
 def test_count_substring2(self):
     self.assertEqual(3, solution.count_substrings("babababa", "baba"))
コード例 #13
0
 def test_count_substring5(self):
     self.assertEqual(0, solution.count_substrings("We have nothing in common!", "really?"))
コード例 #14
0
 def test_count_substrings_3(self):
     self.assertEqual(
         4,
         solution.count_substrings(
             "Python is an awesome language to program in!", "o"))
コード例 #15
0
ファイル: tests.py プロジェクト: egzheleva/HackBulgariaPython
 def testing_count_substring2(self):
     self.assertEqual(2, count_substrings("babababa", "baba"))
コード例 #16
0
ファイル: test.py プロジェクト: gshopov/the-stash
 def test_with_single_character_strings(self):
     self.assertEqual(solution.count_substrings('ala bala portokala', 'a'),
                      6)
     self.assertEqual(solution.count_substrings('yo', 'w'), 0)
コード例 #17
0
ファイル: test.py プロジェクト: gshopov/the-stash
 def test_does_not_count_overlapped_strings(self):
     self.assertEqual(solution.count_substrings('hahahahahahahahaha', 'ha'),
                      9)
コード例 #18
0
ファイル: test.py プロジェクト: gshopov/the-stash
 def test_takes_case_into_consideration(self):
     self.assertEqual(solution.count_substrings("This ain't this!", 'this'),
                      1)
コード例 #19
0
 def test_capital_letters(self):
     self.assertTrue(
         solution.count_substrings("This is this and that is this", "this"))
コード例 #20
0
	def test_count_substrings_3rd(self):
		self.assertEqual(4, solution.count_substrings("Python is an awesome language to program in!", "o"))
コード例 #21
0
 def test_does_not_contains_string(self):
     self.assertFalse(
         solution.count_substrings("We have nothing in common!", "really?"))
コード例 #22
0
 def test_count_substrings(self):
     self.assertEqual(2, solution.count_substrings("This is a test string", "is"))
     self.assertEqual(4, solution.count_substrings("Python is an awesome language to program in!", "o"))
コード例 #23
0
 def test_count_substrings(self):
     self.assertEqual(2,\
             solution.count_substrings("This is a test string", "is"))
     self.assertEqual(2,\
             solution.count_substrings("This is this and that is this",\
             "this"))
コード例 #24
0
 def test_count_substring1(self):
     self.assertEqual(2, solution.count_substrings("This is a test string", "is"))
コード例 #25
0
	def test_count_substrings_4(self):
		self.assertEqual(0, solution.count_substrings("We have nothing in common!", "really?"))
コード例 #26
0
 def test_contains_string(self):
     self.assertTrue(solution.count_substrings("This is a test string", "is"))
コード例 #27
0
 def test_count_substrings(self):
     self.assertEqual(count_substrings("babababa", "baba"), 2)
     self.assertEqual(
         count_substrings("What what wHat what WwhAtwwhattt", "what"), 3)
     self.assertEqual(count_substrings('', ''), 1)
コード例 #28
0
 def test_capital_letters(self):
     self.assertTrue(solution.count_substrings("This is this and that is this", "this"))
コード例 #29
0
 def test_five(self):
     self.assertEqual(2, count_substrings("This is this and that is this", "this"))
コード例 #30
0
ファイル: test.py プロジェクト: miAndreev/Programming101-2
 def test_vour(self):
     self.assertEquals(
         0, count_substrings("We have nothing in common!", "really?"))
コード例 #31
0
 def test_two(self):
     self.assertEqual(2, count_substrings("babababa", "baba"))
コード例 #32
0
ファイル: test.py プロジェクト: miAndreev/Programming101-2
 def test_one(self):
     self.assertEquals(2, count_substrings("This is a test string", "is"))
コード例 #33
0
ファイル: tests.py プロジェクト: snejy/Programming101
 def test_with_no_matches(self):
     self.assertEqual(0, solution.count_substrings("We have nothing in common!", "really?"))
コード例 #34
0
ファイル: test.py プロジェクト: smo93/hackbulgaria
 def test_count_substrings(self):
     self.assertEqual(2,\
             solution.count_substrings("This is a test string", "is"))
     self.assertEqual(2,\
             solution.count_substrings("This is this and that is this",\
             "this"))
コード例 #35
0
ファイル: tests.py プロジェクト: snejy/Programming101
 def test_with_two_digit_substring(self):
     self.assertEqual(2, solution.count_substrings("This is a test string", "is"))
コード例 #36
0
 def test_four(self):
     self.assertEqual(0, count_substrings("We have nothing in common!", "really?"))
コード例 #37
0
 def test_contains_string(self):
     self.assertTrue(
         solution.count_substrings("This is a test string", "is"))
コード例 #38
0
 def test_one(self):
     self.assertEqual(2, count_substrings("This is a test string", "is"))
コード例 #39
0
ファイル: test.py プロジェクト: h3lgi/HackBulgaria
 def test_count_substrings_2(self):
     self.assertEqual(7, count_substrings("alalalkalallalllla", "a"))
コード例 #40
0
ファイル: tests.py プロジェクト: snejy/Programming101
 def test_with_one_symbol(self):
     self.assertEqual(4, solution.count_substrings("Python is an awesome language to program in!", "o"))
コード例 #41
0
ファイル: test.py プロジェクト: lytenica/Zadachi
 def test_solution(self):
     self.assertEqual(2,count_substrings("This is a test string", "is"))
     self.assertEqual(0,count_substrings("We have nothing in common!", "really?"))
コード例 #42
0
ファイル: tests.py プロジェクト: snejy/Programming101
 def test_with_lowercase_word(self):
     self.assertEqual(2, solution.count_substrings("This is this and that is this", "this"))
コード例 #43
0
 def test_count_substring3(self):
     self.assertEqual(2, solution.count_substrings("This is this and that is this", "this"))
コード例 #44
0
ファイル: tests.py プロジェクト: snejy/Programming101
 def test_with_equal_substring(self):
     self.assertEqual(2, solution.count_substrings("babababa", "baba"))
コード例 #45
0
 def test_contains_digit(self):
     self.assertEqual(2, solution.count_substrings("This is a test string","is"))
     self.assertEqual(2, solution.count_substrings("babababa", "baba"))
     self.assertEqual(4, solution.count_substrings("Python is an awesome language to program in!", "o"))
     self.assertEqual(1, solution.count_substrings("Python is an awesome language to program in!", "prog"))
     self.assertEqual(23, solution.count_substrings("Pyth,,,,,,,,,,,,,,,,,,,,,,,rogram in!", ","))