test_prevent_modifications_to_indexer_strings.py 536 B

12345678910111213141516
  1. from hashlib import sha256
  2. LOCKED_FILE = "src/sentry/sentry_metrics/indexer/strings.py"
  3. LOCKED_DIGEST = "a0395ac3cc5c59712f1875c69b107575a13a5c79b730a37508eea0aa4ab73675"
  4. MESSAGE = f"""{LOCKED_FILE} is locked.
  5. * We have detected you made changes to this file.
  6. * We've locked this file following INC-680.
  7. * Please remove the changes to this file.
  8. """
  9. def test_prevent_indexer_strings_modification():
  10. with open(LOCKED_FILE, "rb") as f:
  11. digest = sha256(f.read()).hexdigest()
  12. assert LOCKED_DIGEST == digest, MESSAGE