https://git.wmi.amu.edu.pl/tdwojak/Python2017/src/master/labs03 #1

Open
s45158 wants to merge 17 commits from s45158/Python2017:master into master
Showing only changes of commit 74b2516c90 - Show all commits

View File

@ -8,8 +8,29 @@ Np. leet('leet') powinno zwrócić '1337'.
"""
def leet_speak(tekst):
return tekst.replace('o', '0').replace('l', '1').replace('e', '3').replace('t', '7')
def leet_speak(text):
pass
def test_special_cases(self):
"""Przypadki szczególne."""
self.assertEqual(leet_speak(''), '')
self.assertEqual(leet_speak('x'), 'x')
self.assertEqual(leet_speak('o'), '0')
self.assertEqual(leet_speak('banan'), 'banan')
self.assertEqual(leet_speak('1337'), '1337')
self.assertEqual(leet_speak('admin1'), 'admin1')
def test_standard_cases(self):
"""Standardowe przypadki."""
self.assertEqual(leet_speak('leet'), '1337')
self.assertEqual(leet_speak('mouse'), 'm0us3')
self.assertEqual(leet_speak('do not want'), 'd0 n07 wan7')
def tests(f):