def test_validation(self): """Success case.""" sansio.validate_event(self.payload, secret=self.secret, signature=self.signature)
def test_failure(self): with pytest.raises(ValidationFailure): sansio.validate_event(self.payload + b"!", secret=self.secret, signature=self.signature)
def test_malformed_signature(self): """Error out if the signature doesn't start with "sha1=".""" with pytest.raises(ValidationFailure): sansio.validate_event(self.payload, secret=self.secret, signature=self.hash_signature)