[gedit-plugins/sessionsaver] Update called
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins/sessionsaver] Update called
- Date: Wed, 3 Jul 2019 08:24:19 +0000 (UTC)
commit 8b568ddb3ac0cc6aec6bfb4d70fe5c0afa5b720b
Author: Jordi Mas <jmas softcatala org>
Date: Wed Jul 3 10:24:23 2019 +0200
Update called
plugins/sessionsaver/tests/testsessionstore.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/plugins/sessionsaver/tests/testsessionstore.py b/plugins/sessionsaver/tests/testsessionstore.py
index b168898..06ec32f 100644
--- a/plugins/sessionsaver/tests/testsessionstore.py
+++ b/plugins/sessionsaver/tests/testsessionstore.py
@@ -38,28 +38,35 @@ class TestSessionStore(unittest.TestCase):
self.assertEqual(1, len(store_a))
self.assertEqual(2, len(store_b))
- def on_session_added(self, store, session):
+ def _on_session_added(self, store, session):
self.added_called = True
def test_add(self):
self.added_called = False
session = Session("session_A")
store = SessionStore()
- store.connect_after('session-added', self.on_session_added)
+ store.connect_after('session-added', self._on_session_added)
store.add(session)
self.assertEqual(1, len(store))
self.assertTrue(self.added_called)
+ def _on_session_updated(self, store, session):
+ self.updated_called = True
+
def test_add_same_object_update(self):
+ self.updated_called = False
session = Session("session_A")
store = SessionStore()
+ store.connect_after('session-added', self._on_session_updated)
store.add(session)
session.name = 'Session B'
store.add(session)
+
self.assertEqual(1, len(store))
self.assertEqual('Session B', store[0].name)
+ self.assertTrue(self.updated_called)
def test_add_equal_object(self):
session_a = Session("session_A")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]