(cls)
| 119 | |
| 120 | @classmethod |
| 121 | def phase1(cls) -> str: |
| 122 | return "\n\n".join( |
| 123 | [ |
| 124 | # Include the header. |
| 125 | header(f"{cls.__name__} (phase 1)", drop_schema=True), |
| 126 | cls.initialize(), |
| 127 | # Ensure the feature is off, regardless of CI config. |
| 128 | alter_system_set(cls.feature_name(), "off"), |
| 129 | # We cannot create item #1 when the feature is turned off (default). |
| 130 | statement_error(cls.create_item(ordinal=1), cls.feature_error()), |
| 131 | # Turn the feature on. |
| 132 | alter_system_set(cls.feature_name(), "on"), |
| 133 | # We can create item #1 when the feature is turned on. |
| 134 | statement_ok(cls.create_item(ordinal=1)), |
| 135 | # We can query item #1 when the feature is turned on. |
| 136 | query_ok(cls.query_item(ordinal=1)), |
| 137 | # Turn the feature off. |
| 138 | alter_system_set(cls.feature_name(), "off"), |
| 139 | # We cannot create item #2 when the feature is turned off. |
| 140 | statement_error(cls.create_item(ordinal=2), cls.feature_error()), |
| 141 | ] |
| 142 | ) |
| 143 | |
| 144 | @classmethod |
| 145 | def phase2(cls) -> str: |
no test coverage detected