settings.py 999 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. import random
  10. from enum import Enum
  11. class Complexity(Enum):
  12. Read = "read"
  13. DML = "dml"
  14. DDL = "ddl"
  15. DDLOnly = "ddl-only"
  16. @classmethod
  17. def _missing_(cls, value):
  18. if value == "random":
  19. return cls(random.choice([elem.value for elem in cls]))
  20. class Scenario(Enum):
  21. Regression = "regression"
  22. Cancel = "cancel"
  23. Kill = "kill"
  24. Rename = "rename"
  25. BackupRestore = "backup-restore"
  26. ZeroDowntimeDeploy = "0dt-deploy"
  27. @classmethod
  28. def _missing_(cls, value):
  29. if value == "random":
  30. return cls(random.choice([elem.value for elem in cls]))