repository is now a presentation-ready development prototype
This commit is contained in:
@@ -104,6 +104,20 @@ class SchemaTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(baselines.SchemaError, "owner_zip_code"):
|
||||
baselines.validate_schema(columns)
|
||||
|
||||
def test_prohibited_sensitive_columns_fail_closed(self) -> None:
|
||||
for column in (
|
||||
"technician_id",
|
||||
"inspection_technician_code",
|
||||
"inspector_identifier",
|
||||
"database_password",
|
||||
"api_secret_value",
|
||||
"raw_inspection_json",
|
||||
"row_prediction_probability",
|
||||
):
|
||||
with self.subTest(column=column):
|
||||
with self.assertRaisesRegex(baselines.SchemaError, column):
|
||||
baselines.validate_schema(list(valid_record().keys()) + [column])
|
||||
|
||||
def test_duplicate_columns_fail_closed(self) -> None:
|
||||
columns = list(valid_record().keys()) + ["vehicle_token"]
|
||||
with self.assertRaisesRegex(baselines.SchemaError, "duplicate"):
|
||||
|
||||
@@ -193,6 +193,19 @@ class DashboardExportTests(unittest.TestCase):
|
||||
"development_preview": True,
|
||||
"population_estimate_allowed": False,
|
||||
}
|
||||
for unsafe_field in (
|
||||
"technician_id",
|
||||
"inspection_technician_code",
|
||||
"inspector_identifier",
|
||||
"database_password",
|
||||
"api_secret_value",
|
||||
):
|
||||
with self.subTest(unsafe_field=unsafe_field):
|
||||
with self.assertRaises(dashboard_export.PublicSchemaError):
|
||||
dashboard_export._scan_public_value(
|
||||
{unsafe_field: "not-public"}
|
||||
)
|
||||
|
||||
unsafe_key = {
|
||||
**base,
|
||||
"rows": [
|
||||
|
||||
Reference in New Issue
Block a user