예제 #1
0
 def test_validation(self):
     """Success case."""
     sansio.validate_event(self.payload,
                           secret=self.secret,
                           signature=self.signature)
예제 #2
0
 def test_failure(self):
     with pytest.raises(ValidationFailure):
         sansio.validate_event(self.payload + b"!",
                               secret=self.secret,
                               signature=self.signature)
예제 #3
0
 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)