Пример #1
0
    def test_full_song(self):
        expected = []
        for n in range(1, 9):
            #expected += recite(n, n) + [""]
            expected += recite(n, n)

        #expected.pop()
        self.assertEqual(recite(1, 8), expected)
Пример #2
0
 def test_spider(self):
     expected = [
         "I know an old lady who swallowed a spider.",
         "It wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(2, 2), expected)
Пример #3
0
def test_spider():
    expected = [
        "I know an old lady who swallowed a spider."
        "It wriggled and jiggled and tickled inside her."
        "She swallowed the spider to catch the fly."
        "I don't know why she swallowed the fly. Perhaps she'll die."
    ]
    assert recite(2, 2) == expected
Пример #4
0
 def test_fly(self):
     self.assertEqual(
         recite(1, 1),
         [
             "I know an old lady who swallowed a fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
         ],
     )
Пример #5
0
 def test_horse(self):
     self.assertEqual(
         recite(8, 8),
         [
             "I know an old lady who swallowed a horse.",
             "She's dead, of course!"
         ],
     )
Пример #6
0
 def test_spider(self):
     expected = [
         "I know an old lady who swallowed a spider.",
         "It wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(2, 2), expected)
Пример #7
0
 def test_full_song(self):
     self.assertEqual(
         recite(1, 8),
         [
             "I know an old lady who swallowed a fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a spider.",
             "It wriggled and jiggled and tickled inside her.",
             "She swallowed the spider to catch the fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a bird.",
             "How absurd to swallow a bird!",
             "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.",
             "She swallowed the spider to catch the fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a cat.",
             "Imagine that, to swallow a cat!",
             "She swallowed the cat to catch the bird.",
             "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.",
             "She swallowed the spider to catch the fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a dog.",
             "What a hog, to swallow a dog!",
             "She swallowed the dog to catch the cat.",
             "She swallowed the cat to catch the bird.",
             "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.",
             "She swallowed the spider to catch the fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a goat.",
             "Just opened her throat and swallowed a goat!",
             "She swallowed the goat to catch the dog.",
             "She swallowed the dog to catch the cat.",
             "She swallowed the cat to catch the bird.",
             "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.",
             "She swallowed the spider to catch the fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a cow.",
             "I don't know how she swallowed a cow!",
             "She swallowed the cow to catch the goat.",
             "She swallowed the goat to catch the dog.",
             "She swallowed the dog to catch the cat.",
             "She swallowed the cat to catch the bird.",
             "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.",
             "She swallowed the spider to catch the fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a horse.",
             "She's dead, of course!",
         ],
     )
Пример #8
0
 def test_bird(self):
     expected = [
         "I know an old lady who swallowed a bird.",
         "How absurd to swallow a bird!",
         "She swallowed the bird to catch the spider that "
         "wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(3, 3), expected)
Пример #9
0
def test_bird():
    expected = [
        "I know an old lady who swallowed a bird."
        "How absurd to swallow a bird!"
        "She swallowed the bird to catch the spider that "
        "wriggled and jiggled and tickled inside her."
        "She swallowed the spider to catch the fly."
        "I don't know why she swallowed the fly. Perhaps she'll die."
    ]
    assert recite(3, 3) == expected
Пример #10
0
 def test_bird(self):
     expected = [
         "I know an old lady who swallowed a bird.",
         "How absurd to swallow a bird!",
         "She swallowed the bird to catch the spider that "
         "wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(3, 3), expected)
Пример #11
0
 def test_cat(self):
     expected = [
         "I know an old lady who swallowed a cat.",
         "Imagine that, to swallow a cat!",
         "She swallowed the cat to catch the bird.",
         "She swallowed the bird to catch the spider that "
         "wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(4, 4), expected)
Пример #12
0
 def test_cat(self):
     expected = [
         "I know an old lady who swallowed a cat.",
         "Imagine that, to swallow a cat!",
         "She swallowed the cat to catch the bird.",
         "She swallowed the bird to catch the spider that "
         "wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(4, 4), expected)
Пример #13
0
 def test_dog(self):
     expected = [
         "I know an old lady who swallowed a dog.",
         "What a hog, to swallow a dog!",
         "She swallowed the dog to catch the cat.",
         "She swallowed the cat to catch the bird.",
         "She swallowed the bird to catch the spider that wriggled "
         "and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(5, 5), expected)
Пример #14
0
 def test_dog(self):
     expected = [
         "I know an old lady who swallowed a dog.",
         "What a hog, to swallow a dog!",
         "She swallowed the dog to catch the cat.",
         "She swallowed the cat to catch the bird.",
         "She swallowed the bird to catch the spider that wriggled "
         "and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(5, 5), expected)
Пример #15
0
 def test_goat(self):
     expected = [
         "I know an old lady who swallowed a goat.",
         "Just opened her throat and swallowed a goat!",
         "She swallowed the goat to catch the dog.",
         "She swallowed the dog to catch the cat.",
         "She swallowed the cat to catch the bird.",
         "She swallowed the bird to catch the spider that "
         "wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(6, 6), expected)
Пример #16
0
 def test_goat(self):
     expected = [
         "I know an old lady who swallowed a goat.",
         "Just opened her throat and swallowed a goat!",
         "She swallowed the goat to catch the dog.",
         "She swallowed the dog to catch the cat.",
         "She swallowed the cat to catch the bird.",
         "She swallowed the bird to catch the spider that "
         "wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(6, 6), expected)
Пример #17
0
 def test_cow(self):
     expected = [
         "I know an old lady who swallowed a cow.",
         "I don't know how she swallowed a cow!",
         "She swallowed the cow to catch the goat.",
         "She swallowed the goat to catch the dog.",
         "She swallowed the dog to catch the cat.",
         "She swallowed the cat to catch the bird.",
         "She swallowed the bird to catch the spider that "
         "wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(7, 7), expected)
Пример #18
0
 def test_cow(self):
     expected = [
         "I know an old lady who swallowed a cow.",
         "I don't know how she swallowed a cow!",
         "She swallowed the cow to catch the goat.",
         "She swallowed the goat to catch the dog.",
         "She swallowed the dog to catch the cat.",
         "She swallowed the cat to catch the bird.",
         "She swallowed the bird to catch the spider that "
         "wriggled and jiggled and tickled inside her.",
         "She swallowed the spider to catch the fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(7, 7), expected)
Пример #19
0
 def test_multiple_verses(self):
     self.assertEqual(
         recite(1, 3),
         [
             "I know an old lady who swallowed a fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a spider.",
             "It wriggled and jiggled and tickled inside her.",
             "She swallowed the spider to catch the fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
             "",
             "I know an old lady who swallowed a bird.",
             "How absurd to swallow a bird!",
             "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.",
             "She swallowed the spider to catch the fly.",
             "I don't know why she swallowed the fly. Perhaps she'll die.",
         ],
     )
Пример #20
0
 def test_horse(self):
     self.assertEqual(recite(8, 8), '\n'.join(v8))
Пример #21
0
 def test_multiple_verses(self):
     expected = '\n\n'.join(verse(n) for n in range(1, 4))
     self.assertEqual(recite(1, 3), expected)
Пример #22
0
 def test_full_song(self):
     expected = '\n\n'.join(verse(n) for n in range(1, 9))
     self.assertEqual(recite(1, 8), expected)
 def test_multiple_verses(self):
     expected = [recite(n, n)[0] for n in range(1, 4)]
     self.assertEqual(recite(1, 3), expected)
Пример #24
0
 def test_cat(self):
     self.assertEqual(recite(4, 4), '\n'.join(v4))
Пример #25
0
 def test_goat(self):
     self.assertEqual(recite(6, 6), '\n'.join(v6))
Пример #26
0
 def test_multiple_verses(self):
     expected = [recite(n, n)[0] for n in range(1, 4)]
     self.assertEqual(recite(1, 3), expected)
Пример #27
0
def test_multiple_verses():
    #expected = recite(1, 1) + [""] + recite(2, 2) + [""] + recite(3, 3)
    expected = recite(1, 1) + recite(2, 2) + recite(3, 3)
    assert recite(1, 3) == expected
Пример #28
0
 def test_multiple_verses(self):
     expected = recite(1, 1) + [""] + recite(2, 2) + [""] + recite(3, 3)
     self.assertEqual(recite(1, 3), expected)
Пример #29
0
 def test_bird(self):
     self.assertEqual(recite(3, 3), '\n'.join(v3))
Пример #30
0
 def test_horse(self):
     expected = [
         "I know an old lady who swallowed a horse.",
         "She's dead, of course!",
     ]
     self.assertEqual(recite(8, 8), expected)
 def test_full_song(self):
     expected = [recite(n, n)[0] for n in range(1, 9)]
     self.assertEqual(recite(1, 8), expected)
Пример #32
0
 def test_cow(self):
     self.assertEqual(recite(7, 7), '\n'.join(v7))
Пример #33
0
 def test_fly(self):
     expected = [
         "I know an old lady who swallowed a fly."
         "I don't know why she swallowed the fly. Perhaps she'll die."
     ]
     self.assertEqual(recite(1, 1), expected)
Пример #34
0
 def test_full_song(self):
     expected = [recite(n, n)[0] for n in range(1, 9)]
     self.assertEqual(recite(1, 8), expected)
Пример #35
0
 def test_dog(self):
     self.assertEqual(recite(5, 5), '\n'.join(v5))
Пример #36
0
def test_fly():
    expected = [
        "I know an old lady who swallowed a fly."
        "I don't know why she swallowed the fly. Perhaps she'll die."
    ]
    assert recite(1, 1) == expected
Пример #37
0
def test_horse():
    expected = [
        "I know an old lady who swallowed a horse."
        "She's dead, of course!"
    ]
    assert recite(8, 8) == expected
Пример #38
0
 def test_full_song(self):
     expected = []
     for n in range(1, 9):
         expected += recite(n, n) + [""]
     expected.pop()
     self.assertEqual(recite(1, 8), expected)
Пример #39
0
 def test_fly(self):
     expected = [
         "I know an old lady who swallowed a fly.",
         "I don't know why she swallowed the fly. Perhaps she'll die.",
     ]
     self.assertEqual(recite(1, 1), expected)
Пример #40
0
 def test_horse(self):
     expected = [
         "I know an old lady who swallowed a horse.",
         "She's dead, of course!",
     ]
     self.assertEqual(recite(8, 8), expected)
Пример #41
0
 def test_multiple_verses(self):
     expected = recite(1, 1) + [""] + recite(2, 2) + [""] + recite(3, 3)
     self.assertEqual(recite(1, 3), expected)
Пример #42
0
 def test_spider(self):
     self.assertEqual(recite(2, 2), '\n'.join(v2))