Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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.",
         ],
     )
Exemplo n.º 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!"
         ],
     )
Exemplo n.º 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)
Exemplo n.º 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!",
         ],
     )
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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.",
         ],
     )
Exemplo n.º 20
0
 def test_horse(self):
     self.assertEqual(recite(8, 8), '\n'.join(v8))
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 24
0
 def test_cat(self):
     self.assertEqual(recite(4, 4), '\n'.join(v4))
Exemplo n.º 25
0
 def test_goat(self):
     self.assertEqual(recite(6, 6), '\n'.join(v6))
Exemplo n.º 26
0
 def test_multiple_verses(self):
     expected = [recite(n, n)[0] for n in range(1, 4)]
     self.assertEqual(recite(1, 3), expected)
Exemplo n.º 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
Exemplo n.º 28
0
 def test_multiple_verses(self):
     expected = recite(1, 1) + [""] + recite(2, 2) + [""] + recite(3, 3)
     self.assertEqual(recite(1, 3), expected)
Exemplo n.º 29
0
 def test_bird(self):
     self.assertEqual(recite(3, 3), '\n'.join(v3))
Exemplo n.º 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)
Exemplo n.º 32
0
 def test_cow(self):
     self.assertEqual(recite(7, 7), '\n'.join(v7))
Exemplo n.º 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)
Exemplo n.º 34
0
 def test_full_song(self):
     expected = [recite(n, n)[0] for n in range(1, 9)]
     self.assertEqual(recite(1, 8), expected)
Exemplo n.º 35
0
 def test_dog(self):
     self.assertEqual(recite(5, 5), '\n'.join(v5))
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 41
0
 def test_multiple_verses(self):
     expected = recite(1, 1) + [""] + recite(2, 2) + [""] + recite(3, 3)
     self.assertEqual(recite(1, 3), expected)
Exemplo n.º 42
0
 def test_spider(self):
     self.assertEqual(recite(2, 2), '\n'.join(v2))