def test_insert_special_char(self): # we can insert special chars in words. fake_rnd = FakeRandom() result1 = insert_special_char('foo', specials='bar', rnd=fake_rnd) assert result1 == 'boo' fake_rnd.nums_to_draw = [1, 1] result2 = insert_special_char('foo', specials='bar', rnd=fake_rnd) assert result2 == 'fao' fake_rnd.nums_to_draw = [2, 2] result3 = insert_special_char('foo', specials='bar', rnd=fake_rnd) assert result3 == 'for' fake_rnd.nums_to_draw = [0, 0] result4 = insert_special_char('foo', rnd=fake_rnd) assert result4 == '~oo'
def test_insert_special_char(self): # we can insert special chars in words. fake_rnd = FakeRandom() result1 = insert_special_char('foo', specials='bar', rnd=fake_rnd) assert result1 == 'boo' fake_rnd.nums_to_draw = [1, 1] result2 = insert_special_char('foo', specials='bar', rnd=fake_rnd) assert result2 == 'fao' fake_rnd.nums_to_draw = [2, 2] result3 = insert_special_char('foo', specials='bar', rnd=fake_rnd) assert result3 == 'for' fake_rnd.nums_to_draw = [0, 0] result4 = insert_special_char('foo', rnd=fake_rnd) assert result4 == '~oo'
def test_insert_special_char_defaults(self): # defaults are respected expected_matrix = [] for i in range(3): for j in range(len(SPECIAL_CHARS)): word = list('foo') word[i] = SPECIAL_CHARS[j] expected_matrix.append(''.join(word)) for x in range(100): assert insert_special_char('foo') in expected_matrix
def test_insert_special_char_defaults(self): # defaults are respected expected_matrix = [] for i in range(3): for j in range(len(SPECIAL_CHARS)): word = list('foo') word[i] = SPECIAL_CHARS[j] expected_matrix.append(''.join(word)) for x in range(100): assert insert_special_char('foo') in expected_matrix