Пример #1
0
 def test_webhook_secret_validation_empty(self):
     """
     Tests the webhook_secret_validation method
     """
     cla.config.GITHUB_APP_WEBHOOK_SECRET = ""
     with self.assertRaises(RuntimeError) as ex:
         _ = webhook_secret_validation("secret", b'')
Пример #2
0
 def test_webhook_secret_validation_success(self):
     """
     Tests the webhook_secret_validation method
     """
     cla.config.GITHUB_APP_WEBHOOK_SECRET = "secret"
     input_data = 'data'.encode('utf-8')
     assert webhook_secret_validation("sha1=9818e3306ba5ac267b5f2679fe4abd37e6cd7b54", input_data)
Пример #3
0
 def test_webhook_secret_validation_failed(self):
     """
     Tests the webhook_secret_validation method
     """
     cla.config.GITHUB_APP_WEBHOOK_SECRET = "secret"
     assert not webhook_secret_validation("sha1=secret", ''.encode())