1
0
forked from tdwojak/Python2017

poprawione zad 9

This commit is contained in:
s45158 2017-12-16 12:54:28 +01:00
parent 04b8001333
commit 063a952e72

View File

@ -12,26 +12,6 @@ def leet_speak(tekst):
return tekst.replace('o', '0').replace('l', '1').replace('e', '3').replace('t', '7') return tekst.replace('o', '0').replace('l', '1').replace('e', '3').replace('t', '7')
def leet_speak(text):
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): def tests(f):
inputs = [['leet'], ['do not want']] inputs = [['leet'], ['do not want']]