def f_replace_secret_with_hashes(self, msg): replaced = msg.replace("secret", "######") if msg != replaced: return state.replace(replaced) return state.next(msg)
def h_replace(self, t): return state.replace("pokusny")
def test_not_next(self): self.assertFalse(state.is_next(state.done(None))) self.assertFalse(state.is_next(state.replace(None)))
def test_replace(self): self.assertTrue(state.is_replace(state.replace(None)))
def filter_strip(msg): return state.replace(msg.strip())