diff --git a/src/DynamoCore/DynamoCore.csproj b/src/DynamoCore/DynamoCore.csproj index 30df23d485c..9dc872dafe5 100644 --- a/src/DynamoCore/DynamoCore.csproj +++ b/src/DynamoCore/DynamoCore.csproj @@ -1,4 +1,4 @@ - + @@ -40,7 +40,7 @@ - + diff --git a/src/PythonMigrationViewExtension/PythonMigrationViewExtension.csproj b/src/PythonMigrationViewExtension/PythonMigrationViewExtension.csproj index 54759ebc6f3..a7124196651 100644 --- a/src/PythonMigrationViewExtension/PythonMigrationViewExtension.csproj +++ b/src/PythonMigrationViewExtension/PythonMigrationViewExtension.csproj @@ -15,7 +15,7 @@ - + runtime;native;contentFiles;build;buildTransitive;analyzers all diff --git a/test/Libraries/DynamoPythonTests/DynamoPythonTests.csproj b/test/Libraries/DynamoPythonTests/DynamoPythonTests.csproj index 9d9461ac5ef..ef653a2ed8b 100644 --- a/test/Libraries/DynamoPythonTests/DynamoPythonTests.csproj +++ b/test/Libraries/DynamoPythonTests/DynamoPythonTests.csproj @@ -22,7 +22,7 @@ - + runtime;native;contentFiles;build;buildTransitive;analyzers all diff --git a/test/Libraries/DynamoPythonTests/PythonEvalTestsWithLibraries.cs b/test/Libraries/DynamoPythonTests/PythonEvalTestsWithLibraries.cs index 1449b4cff7d..ce03437de7a 100644 --- a/test/Libraries/DynamoPythonTests/PythonEvalTestsWithLibraries.cs +++ b/test/Libraries/DynamoPythonTests/PythonEvalTestsWithLibraries.cs @@ -44,14 +44,7 @@ from FFITarget import DummyMath } } - /// - /// PythonNet3 vs DesignScript list interop issue: - /// DSCore list ops expect DS lists; PythonNet passes .NET lists, causing wrong overloads/comparers. - /// Quarantined until parity fix. - /// [Test] - [Category("Failure")] - [Category("TechDebt")] public void TestListDecoding() { string code = @" @@ -344,6 +337,52 @@ import DSCore } } + [Test] + public void TryDecode_ConvertsNestedPythonListsToClrLists() + { + string code = @" +import clr +clr.AddReference('DSCoreNodes') +from DSCore import List + +data = [[[1, 2], [3]], [[4, 5], [6]]] +OUT = data, List.Flatten(data, 1), List.Flatten(data, 2), List.Flatten(data) +"; + var emptyInputs = new ArrayList(); + var expected = new ArrayList + { + new ArrayList + { + new ArrayList + { + new ArrayList { 1, 2 }, + new ArrayList { 3 } + }, + new ArrayList + { + new ArrayList { 4, 5 }, + new ArrayList { 6 } + } + }, + new ArrayList + { + new ArrayList { 1, 2 }, + new ArrayList { 3 }, + new ArrayList { 4, 5 }, + new ArrayList { 6 } + }, + new ArrayList { 1, 2, 3, 4, 5, 6 }, + new ArrayList { 1, 2, 3, 4, 5, 6 } + }; + + foreach (var pythonEvaluator in Evaluators) + { + var result = pythonEvaluator(code, emptyInputs, emptyInputs); + Assert.That(result, Is.InstanceOf()); + CollectionAssert.AreEqual(expected, result as IEnumerable); + } + } + private void DictionaryAssert(IDictionary expected, IDictionary actual) { Assert.AreEqual(expected.Count, actual.Count);