TestGetWebContainerDirectURLsErrorHandling tests error handling in GetWebContainerDirectHTTPURL and GetWebContainerDirectHTTPSURL
(t *testing.T)
| 3814 | |
| 3815 | // TestGetWebContainerDirectURLsErrorHandling tests error handling in GetWebContainerDirectHTTPURL and GetWebContainerDirectHTTPSURL |
| 3816 | func TestGetWebContainerDirectURLsErrorHandling(t *testing.T) { |
| 3817 | assert := asrt.New(t) |
| 3818 | |
| 3819 | // Create a temporary directory for a new app |
| 3820 | testDir := testcommon.CreateTmpDir(t.Name()) |
| 3821 | defer testcommon.CleanupDir(testDir) |
| 3822 | defer testcommon.Chdir(testDir)() |
| 3823 | |
| 3824 | // Create a new app that hasn't been started yet |
| 3825 | app, err := ddevapp.NewApp(testDir, true) |
| 3826 | require.NoError(t, err) |
| 3827 | |
| 3828 | // Verify that GetWebContainerDirectHTTPURL returns an empty string when container doesn't exist |
| 3829 | httpURL := app.GetWebContainerDirectHTTPURL() |
| 3830 | assert.Empty(httpURL, "GetWebContainerDirectHTTPURL should return an empty string when container doesn't exist") |
| 3831 | |
| 3832 | // Verify that GetWebContainerDirectHTTPSURL returns an empty string when container doesn't exist |
| 3833 | httpsURL := app.GetWebContainerDirectHTTPSURL() |
| 3834 | assert.Empty(httpsURL, "GetWebContainerDirectHTTPSURL should return an empty string when container doesn't exist") |
| 3835 | } |
| 3836 | |
| 3837 | // TestGetWebContainerDirectURLsWithGenericWebserver tests the behavior of GetWebContainerDirectHTTPURL and GetWebContainerDirectHTTPSURL |
| 3838 | // with a generic webserver type and web_extra_exposed_ports |
nothing calls this directly
no test coverage detected