summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-12-12 17:07:05 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-12-12 17:07:05 (GMT)
commitc806bc75910c129c6d78115cfdc571316e060412 (patch)
tree3752138befa5508fe43ea3410237c5edb1163cbf /tests
parentd5b598b14fd4c50847ce536692ded258ba1720ca (diff)
Reorganized the global variables access in the Python bindings.
Diffstat (limited to 'tests')
-rw-r--r--tests/core/global.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/core/global.py b/tests/core/global.py
new file mode 100644
index 0000000..a929940
--- /dev/null
+++ b/tests/core/global.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python3-dbg
+# -*- coding: utf-8 -*-
+
+
+from chrysacase import ChrysalideTestCase
+from pychrysalide.analysis import StudyProject
+from pychrysalide.core import get_current_project, set_current_project
+
+
+class TestCoreGlobal(ChrysalideTestCase):
+ """TestCase for analysis.core.global."""
+
+ def testProject(self):
+ """Get and set the current project."""
+
+ self.assertIsNone(get_current_project())
+
+ prj = StudyProject()
+
+ set_current_project(prj)
+
+ self.assertEqual(get_current_project(), prj)