| ... | ... | @@ -113,9 +113,14 @@ class PreviewProof(unittest.TestCase): |
| 113 | 113 | def exists(path): |
| 114 | 114 | return str(path).startswith("/run/snowglobe-preview/") and path.name == "host.sock" or original_exists(path) |
| 115 | 115 | |
| 116 | | with patch.object(stage.snowglobe, "STATE", state), patch.object(stage.snowglobe, "REPO", root / "releases/1234567890abcdef"), patch.object(stage.snowglobe, "token"), patch.object(stage.snowglobe, "identity", return_value=os.getuid()), patch.object(stage.snowglobe, "check_staging_pool"), patch.object(stage.snowglobe, "check_http"), patch.object(stage.snowglobe, "command", side_effect=command), patch.object(stage.subprocess, "run", side_effect=run), patch.object(stage.os, "chown") as chown, patch.object(stage.snowglobe.transition, "host_environment", return_value="PATH=/bin"), patch.object(stage.snowglobe.transition, "stop_preview"), patch.object(Path, "exists", exists), redirect_stdout(io.StringIO()): |
| 116 | with patch.object(stage.snowglobe, "STATE", state), patch.object(stage.snowglobe, "REPO", root / "releases/1234567890abcdef"), patch.object(stage.snowglobe, "token"), patch.object(stage.snowglobe, "identity", return_value=os.getuid()), patch.object(stage.snowglobe, "check_staging_pool"), patch.object(stage.snowglobe, "check_http") as check_http, patch.object(stage.snowglobe, "command", side_effect=command), patch.object(stage.subprocess, "run", side_effect=run), patch.object(stage.os, "chown") as chown, patch.object(stage.snowglobe.transition, "host_environment", return_value="PATH=/bin"), patch.object(stage.snowglobe.transition, "stop_preview"), patch.object(Path, "exists", exists), redirect_stdout(io.StringIO()): |
| 117 | 117 | stage.stage() |
| 118 | check_http.assert_called_once_with(jobs[-1]["ID"] + ".fixture.test", "/sign-in", True) |
| 118 | 119 | task = jobs[-1]["TaskGroups"][0]["Tasks"][0] |
| 120 | check = jobs[-1]["TaskGroups"][0]["Services"][0]["Checks"][0] |
| 121 | self.assertEqual(check["Type"], "tcp") |
| 122 | self.assertNotIn("Path", check) |
| 123 | self.assertNotIn("Header", check) |
| 119 | 124 | directory = root / "srv/staging" / jobs[-1]["ID"] |
| 120 | 125 | proof = directory / "proxy.token" |
| 121 | 126 | value = proof.read_text() |