def test_render(self): ''' test render ''' secret = 'Use more salt.' crypted = 'NACL[MRN3cc+fmdxyQbz6WMF+jq1hKdU5X5BBI7OjK+atvHo1ll+w1gZ7XyWtZVfq9gK9rQaMfkDxmidJKwE0Mw==]' with patch.dict(nacl.__salt__, {'nacl.dec': MagicMock(return_value=secret)}): self.assertEqual(nacl.render(crypted), secret)
def test_render(): """ test render """ secret = "Use more salt." crypted = "NACL[MRN3cc+fmdxyQbz6WMF+jq1hKdU5X5BBI7OjK+atvHo1ll+w1gZ7XyWtZVfq9gK9rQaMfkDxmidJKwE0Mw==]" with patch.dict(nacl.__salt__, {"nacl.dec": MagicMock(return_value=secret)}): assert nacl.render(crypted) == secret