Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/Libraries/DynamoPythonTests/CodeCompletionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ public void OneTimeSetup()
[TestFixture]
internal class SharedCodeCompletionProviderTests : UnitTestBase
{
[SetUp]
public override void Setup()
{
base.Setup();
//for some legacy tests we'll need the DSPythonNet3 binary loaded manually
//as the types are found using reflection - during normal dynamo use these types are already loaded.
var path = Path.Combine(PathManager.BuiltinPackagesDirectory, @"PythonNet3Engine\extra\DSPythonNet3.dll");
Assembly.LoadFrom(path);
//as the types are found using reflection - during normal dynamo use these types are already loaded.

// Force loading of the DSPythonNet3 assembly by accessing a type from it
// This ensures the assembly is in AppDomain.CurrentDomain.GetAssemblies()
// before SharedCompletionProvider tries to find IExternalCodeCompletionProviderCore implementations
var _ = typeof(DSPythonNet3CodeCompletionProviderCore);
}

[Test]
Expand All @@ -51,6 +55,7 @@ public void SharedCoreCanReturnCLRCompletionData()
var str = "\nimport System.Collections\nSystem.Collections.";

var completionData = provider.GetCompletionData(str);
Assert.IsNotNull(completionData, "GetCompletionData returned null. This typically means the IExternalCodeCompletionProviderCore implementation could not be found. Ensure DSPythonNet3.dll is loaded.");
var completionList = completionData.Select(d => d.Text);

Assert.IsTrue(completionList.Any());
Expand Down
Loading