Exemplo n.º 1
0
 def test_ceaser_output(self):
     decorator = solution.ceaser_output(13)
     cross_the_river = lambda: "ALEA IACTA EST"
     decorated = decorator(cross_the_river)
     self.assertEqual(decorated(), "NYRN VNPGN RFG")
Exemplo n.º 2
0
    def test_the_quick_brown_fox(self):
        message = 'the quick brown fox jumps over the lazy dog'.upper()
        encoded = 'QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD'

        decorator = solution.ceaser_output(3)
        self.assertEqual(decorator(lambda: encoded)(), message)
Exemplo n.º 3
0
 def test_output_with_overflowing(self):
     decorator = solution.ceaser_output(23)
     cross_the_river = lambda: string.ascii_uppercase
     decorated = decorator(cross_the_river)
     self.assertEqual(decorated(), "XYZABCDEFGHIJKLMNOPQRSTUVW")
Exemplo n.º 4
0
 def test_ceaser_output(self):
     decorator = solution.ceaser_output(13)
     cross_the_river = lambda: "ALEA IACTA EST"
     decorated = decorator(cross_the_river)
     self.assertEqual(decorated(), "NYRN VNPGN RFG")
Exemplo n.º 5
0
    def test_the_quick_brown_fox(self):
        message = 'the quick brown fox jumps over the lazy dog'.upper()
        encoded = 'QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD'

        decorator = solution.ceaser_output(3)
        self.assertEqual(decorator(lambda: encoded)(), message)
Exemplo n.º 6
0
 def test_output_with_overflowing(self):
     decorator = solution.ceaser_output(23)
     cross_the_river = lambda: string.ascii_uppercase
     decorated = decorator(cross_the_river)
     self.assertEqual(decorated(), "XYZABCDEFGHIJKLMNOPQRSTUVW")