summaryrefslogtreecommitdiff
path: root/tests/test_internal_api.py
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-03-19 20:18:55 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-03-19 20:18:55 +0100
commite0287a22e61b935ccc856040a3e95e9173d25377 (patch)
treeb4b669386d2f403816256adfaf407855b89d94d8 /tests/test_internal_api.py
parent4656d9073d30e7ffd94b9a60d754d78358ba89c3 (diff)
downloadpygobject-e0287a22e61b935ccc856040a3e95e9173d25377.tar.gz
tests: move testmodule content into test_internal_api
it's the only user and the naming was confusing
Diffstat (limited to 'tests/test_internal_api.py')
-rw-r--r--tests/test_internal_api.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/tests/test_internal_api.py b/tests/test_internal_api.py
index 0cf3e6fd..0778aa63 100644
--- a/tests/test_internal_api.py
+++ b/tests/test_internal_api.py
@@ -7,14 +7,35 @@ import unittest
from gi.repository import GLib, GObject
from . import testhelper
-from . import testmodule
+
+
+class PyGObject(GObject.GObject):
+ __gtype_name__ = 'PyGObject'
+ __gproperties__ = {
+ 'label': (GObject.TYPE_STRING,
+ 'label property',
+ 'the label of the object',
+ 'default',
+ GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE),
+ }
+
+ def __init__(self):
+ self._props = {}
+ GObject.GObject.__init__(self)
+ self.set_property('label', 'hello')
+
+ def do_set_property(self, name, value):
+ self._props[name] = value
+
+ def do_get_property(self, name):
+ return self._props[name]
class TestObject(unittest.TestCase):
def test_create_ctor(self):
- o = testmodule.PyGObject()
+ o = PyGObject()
self.assertTrue(isinstance(o, GObject.Object))
- self.assertTrue(isinstance(o, testmodule.PyGObject))
+ self.assertTrue(isinstance(o, PyGObject))
# has expected property
self.assertEqual(o.props.label, 'hello')
@@ -24,7 +45,7 @@ class TestObject(unittest.TestCase):
def test_pyobject_new_test_type(self):
o = testhelper.create_test_type()
- self.assertTrue(isinstance(o, testmodule.PyGObject))
+ self.assertTrue(isinstance(o, PyGObject))
# has expected property
self.assertEqual(o.props.label, 'hello')