private void TestPublishToWebSite( string templateName, string projectName, string moduleName, string textInResponse, string pythonVersion, int publishTimeout, string packageName = null ) { using (var app = new VisualStudioApp()) { var pyProj = app.CreateProject( PythonVisualStudioApp.TemplateLanguageName, templateName, TestData.GetTempPath(), projectName ).GetPythonProject(); var factory = WebProjectTests.CreateVirtualEnvironment(pythonVersion, app, pyProj); WebProjectTests.InstallWebFramework(app, moduleName, packageName ?? moduleName, factory); _webSiteToDelete = Guid.NewGuid().ToString("N"); var siteUri = app.PublishToAzureWebSite(_webSiteToDelete, publishSettingsFilePath); app.WaitForBuildComplete(publishTimeout); string text = WebDownloadUtility.GetString(siteUri); Console.WriteLine("Response from {0}", siteUri); Console.WriteLine(text); Assert.IsTrue(text.Contains(textInResponse), text); } }
private void TestPublishToWebSite( string languageName, string templateName, string projectName, string expectedProjectItem, string textInResponse, int publishTimeout ) { using (var app = new VisualStudioApp()) { CreateProject( app, languageName, templateName, TestData.GetTempPath(), projectName, expectedProjectItem ); _webSiteToDelete = Guid.NewGuid().ToString("N"); var siteUri = app.PublishToAzureWebSite(_webSiteToDelete, publishSettingsFilePath); app.WaitForBuildComplete(publishTimeout); string text = WebDownloadUtility.GetString(siteUri); Console.WriteLine("Response from {0}", siteUri); Console.WriteLine(text); Assert.IsTrue(text.Contains(textInResponse), text); } }