File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
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
}
You can’t perform that action at this time.
0 commit comments