예제 #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))