Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_malformed_signature(self):
"""Error out if the signature doesn't start with "sha1="."""
with pytest.raises(sansio.ValidationFailure):
sansio.validate(self.payload, secret=self.secret,
signature=self.hash_signature)
def test_validation(self):
"""Success case."""
sansio.validate(self.payload, secret=self.secret,
signature=self.signature)