-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DYN-5125: Fix for modified input nodes that are assigned non-primitiv…
…e values (#13136) * force execute modified input node * check for executing graph node to be non-null * attempt new approach * cleanup * more cleanup * simplify further * final cleanup * add test * hide test node * cleanup * cleanup * cleanup
- Loading branch information
1 parent
80af737
commit ec0dc3d
Showing
8 changed files
with
461 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using NUnit.Framework; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
|
||
namespace Dynamo.Tests | ||
{ | ||
[TestFixture] | ||
internal class UpdateInputNodeModelTest : DynamoModelTestBase | ||
{ | ||
protected override void GetLibrariesToPreload(List<string> libraries) | ||
{ | ||
libraries.Add("DesignScriptBuiltin.dll"); | ||
libraries.Add("DSCoreNodes.dll"); | ||
|
||
base.GetLibrariesToPreload(libraries); | ||
} | ||
|
||
[Test] | ||
public void TestUpdateInputNodeModel() | ||
{ | ||
// DYN file contains nodemodel node that reads an image from hardcoded file name and returns a bitmap | ||
string openPath = Path.Combine(TestDirectory, @"core\astbuilder\updateInputNodeModel.dyn"); | ||
RunModel(openPath); | ||
|
||
// Assert on one of the color values belonging to the image read | ||
var guid = "313bc594-8879-492b-aa99-8efc61c5707a"; | ||
AssertPreviewValue(guid, 91); | ||
|
||
// Create backup of original file | ||
var originalFile = Path.Combine(TestDirectory, @"core\astbuilder\hardcoded_image_file.jpg"); | ||
var backupFile = Path.Combine(TestDirectory, @"core\astbuilder\hardcoded_image_file - Copy.jpg"); | ||
File.Copy(originalFile, backupFile); | ||
|
||
// Overwrite the file "harcoded_image_file.jpg" with the file "harcoded_image_file2.jpg" | ||
var path = Path.Combine(TestDirectory, @"core\astbuilder\hardcoded_image_file2.jpg"); | ||
File.Copy(path, originalFile, true); | ||
|
||
// Force re-execute the nodemodel node | ||
var guid2 = "a787e45f-f6ed-439f-9eb3-60008b4c8a72"; | ||
var nodeModel = CurrentDynamoModel.CurrentWorkspace.NodeFromWorkspace(guid2); | ||
nodeModel.OnNodeModified(true); | ||
|
||
File.Delete(originalFile); | ||
// restore the file, "harcoded_image_file.jpg" | ||
File.Move(backupFile, originalFile); | ||
|
||
// Assert that the same color value has changed as the file is now pointing to a different image | ||
AssertPreviewValue(guid, 41); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.