| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8ce4e0e commit ae8e6f0
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + # -*- coding: utf-8 -*- | ||
| 2 | + | ||
| 3 | + FOO = 1 | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + def test_foo(): | ||
| 7 | + return FOO | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,5 +64,20 @@ public void TestSysArgsImportException() | |||
| 64 | 64 | PyObject module = PythonEngine.ImportModule("PyImportTest.sysargv"); | |
| 65 | 65 | Assert.IsNotNull(module); | |
| 66 | 66 | } | |
| 67 | + | ||
| 68 | + /// <summary> | ||
| 69 | + /// Test Global Variable casting. GH#420 | ||
| 70 | + /// </summary> | ||
| 71 | + [Test] | ||
| 72 | + public void TestCastGlobalVar() | ||
| 73 | + { | ||
| 74 | + dynamic foo = Py.Import("PyImportTest.cast_global_var"); | ||
| 75 | + Assert.AreEqual("1", foo.FOO.ToString()); | ||
| 76 | + Assert.AreEqual("1", foo.test_foo().ToString()); | ||
| 77 | + | ||
| 78 | + foo.FOO = 2; | ||
| 79 | + Assert.AreEqual("2", foo.FOO.ToString()); | ||
| 80 | + Assert.AreEqual("2", foo.test_foo().ToString()); | ||
| 81 | + } | ||
| 67 | 82 | } | |
| 68 | 83 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments