コード例 #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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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
ファイル: test_pytest.py プロジェクト: ynomitna/WS2019
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
ファイル: food_chain_test.py プロジェクト: rvsp/python-1
 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
ファイル: food_chain_test.py プロジェクト: rvsp/python-1
 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
ファイル: food_chain_test.py プロジェクト: rvsp/python-1
 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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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
ファイル: test_pytest.py プロジェクト: ynomitna/WS2019
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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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
ファイル: food_chain_test.py プロジェクト: rvsp/python-1
 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)
コード例 #23
0
 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
ファイル: test_pytest.py プロジェクト: ynomitna/WS2019
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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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)
コード例 #31
0
 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
ファイル: test_pytest.py プロジェクト: ynomitna/WS2019
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
ファイル: test_pytest.py プロジェクト: ynomitna/WS2019
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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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
ファイル: food_chain_test.py プロジェクト: fortrieb/python
 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))