Skip to content

Commit

Permalink
#188 Can't create web role or worker role
Browse files Browse the repository at this point in the history
Changes the UWP project factory GUID to sort before the main Pyhton project factory to avoid failing a test during template search.
Removes an incorrect comment from ProvideLanguageTemplatesAttribute.
Adds a test to ensure templates can be found.
  • Loading branch information
zooba committed Jun 5, 2015
1 parent 9baa835 commit 990c1f8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
12 changes: 0 additions & 12 deletions Python/Product/Django/ProvideLanguageTemplatesAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
using Microsoft.VisualStudio.Shell;

namespace Microsoft.PythonTools.Django {

/// <include file='doc\ProvideEditorExtensionAttribute.uex' path='docs/doc[@for="ProvideEditorExtensionAttribute"]' />
/// <devdoc>
/// This attribute associates a file extension to a given editor factory.
/// The editor factory may be specified as either a GUID or a type and
/// is placed on a package.
///
/// This differs from the normal one in that more than one extension can be supplied and
/// a linked editor GUID can be supplied.
/// </devdoc>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
internal sealed class ProvideLanguageTemplatesAttribute : RegistrationAttribute {
private readonly string _projectFactory, _languageName, _package, _languageGuid, _description, _templateGroup,
Expand All @@ -45,8 +35,6 @@ public ProvideLanguageTemplatesAttribute(string projectFactory, string languageN
_webProjectGuid = webProjectGuid;
}


/// <include file='doc\ProvideEditorExtensionAttribute.uex' path='docs/doc[@for="Register"]' />
/// <devdoc>
/// Called to register this attribute with the given context. The context
/// contains the location where the registration inforomation should be placed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Dictionary<string, ProjectPropertyGroupElement> groups
globals = project.AddPropertyGroup();
}

AddOrSetProperty(globals, "ProjectTypeGuids", "{c85cbf2e-4147-4e9d-87e0-9a2fbf407f6e};{888888A0-9F3D-457C-B088-3A5042F75D52}");
AddOrSetProperty(globals, "ProjectTypeGuids", "{2b557614-1a2b-4903-b9df-ed20d7b63f3a};{888888A0-9F3D-457C-B088-3A5042F75D52}");
}
}
}
2 changes: 1 addition & 1 deletion Python/Product/Uwp/Guids.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace Microsoft.PythonTools.Uwp {
static class GuidList {
public const string guidUwpPkgString = "0a078d3c-15a9-47f5-8418-9ee5db43993d";
public const string guidUwpFactoryString = "c85cbf2e-4147-4e9d-87e0-9a2fbf407f6e";
public const string guidUwpFactoryString = "2b557614-1a2b-4903-b9df-ed20d7b63f3a";
public const string guidUwpPropertyPageString = "700c8e09-f81c-4fb8-a386-508fb48c372d";
public static readonly Guid guidOfficeSharePointCmdSet = new Guid("d26c976c-8ee8-4ec4-8746-f5f7702a17c5");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<SearchPath />
<PackageCertificateKeyFile>$projectname$_TemporaryKey.pfx</PackageCertificateKeyFile>
<DefaultLanguage>$currentuiculturename$</DefaultLanguage>
<ProjectTypeGuids>{c85cbf2e-4147-4e9d-87e0-9a2fbf407f6e};{888888A0-9F3D-457C-B088-3A5042F75D52}</ProjectTypeGuids>
<ProjectTypeGuids>{2b557614-1a2b-4903-b9df-ed20d7b63f3a};{888888A0-9F3D-457C-B088-3A5042F75D52}</ProjectTypeGuids>
<InterpreterId>{86767848-40B4-4007-8BCC-A3835EDF0E69}</InterpreterId>
<InterpreterVersion>3.5</InterpreterVersion>
<RemoteDebugEnabled>true</RemoteDebugEnabled>
Expand Down
25 changes: 25 additions & 0 deletions Python/Tests/Core.UI/BasicProjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,31 @@ public static void DoDeployment(TestContext context) {
PythonTestData.Deploy();
}

[TestMethod, Priority(0), TestCategory("Core")]
[HostType("VSTestHost")]
public void TemplateDirectories() {
var languageName = PythonVisualStudioApp.TemplateLanguageName;
using (var app = new VisualStudioApp()) {
var sln = (Solution2)app.Dte.Solution;

foreach (var templateName in new[] {
#if DEV14_OR_LATER
"BackgroundService.zip",
#endif
PythonVisualStudioApp.PythonApplicationTemplate,
PythonVisualStudioApp.BottleWebProjectTemplate,
PythonVisualStudioApp.DjangoWebProjectTemplate
}) {
var templatePath = sln.GetProjectTemplate(templateName, languageName);
Assert.IsTrue(
File.Exists(templatePath) || Directory.Exists(templatePath),
string.Format("Cannot find template '{0}' for language '{1}'", templateName, languageName)
);
Console.WriteLine("Found {0} at {1}", templateName, templatePath);
}
}
}

[TestMethod, Priority(0), TestCategory("Core")]
[HostType("VSTestHost")]
public void UserProjectFile() {
Expand Down

0 comments on commit 990c1f8

Please sign in to comment.