[gedit-plugins/sessionsaver] Test



commit 2b48df197caa9f21af0ccfba0cb95a2c9e7ebe3a
Author: Jordi Mas <jmas softcatala org>
Date:   Tue Jul 2 16:52:04 2019 +0200

    Test

 plugins/sessionsaver/sessionsaver/appactivable.py  |  2 +-
 plugins/sessionsaver/sessionsaver/dialogs.py       |  2 +-
 .../sessionsaver/{ => store}/session.py            |  0
 .../sessionsaver/{ => store}/sessionstore.py       |  0
 .../sessionsaver/{ => store}/xmlsessionstore.py    |  0
 .../sessionsaver/sessionsaver/windowactivable.py   |  2 +-
 plugins/sessionsaver/tests/meson.build             |  1 +
 plugins/sessionsaver/tests/testsession.py          |  2 +-
 plugins/sessionsaver/tests/testsessionstore.py     | 34 ++++++++++++++++++++++
 9 files changed, 39 insertions(+), 4 deletions(-)
---
diff --git a/plugins/sessionsaver/sessionsaver/appactivable.py 
b/plugins/sessionsaver/sessionsaver/appactivable.py
index 2a63380..0fb4df2 100644
--- a/plugins/sessionsaver/sessionsaver/appactivable.py
+++ b/plugins/sessionsaver/sessionsaver/appactivable.py
@@ -18,7 +18,7 @@
 #  Boston, MA 02110-1301, USA.
 
 from gi.repository import GObject, Gio, Gedit
-from .xmlsessionstore import XMLSessionStore
+from .store.xmlsessionstore import XMLSessionStore
 
 try:
     import gettext
diff --git a/plugins/sessionsaver/sessionsaver/dialogs.py b/plugins/sessionsaver/sessionsaver/dialogs.py
index fb1f2cd..d83ddf7 100644
--- a/plugins/sessionsaver/sessionsaver/dialogs.py
+++ b/plugins/sessionsaver/sessionsaver/dialogs.py
@@ -6,7 +6,7 @@
 from gi.repository import GObject, Gtk, Gedit
 import os.path
 from gpdefs import GETTEXT_PACKAGE
-from .session import Session
+from .store.session import Session
 
 
 try:
diff --git a/plugins/sessionsaver/sessionsaver/session.py b/plugins/sessionsaver/sessionsaver/store/session.py
similarity index 100%
rename from plugins/sessionsaver/sessionsaver/session.py
rename to plugins/sessionsaver/sessionsaver/store/session.py
diff --git a/plugins/sessionsaver/sessionsaver/sessionstore.py 
b/plugins/sessionsaver/sessionsaver/store/sessionstore.py
similarity index 100%
rename from plugins/sessionsaver/sessionsaver/sessionstore.py
rename to plugins/sessionsaver/sessionsaver/store/sessionstore.py
diff --git a/plugins/sessionsaver/sessionsaver/xmlsessionstore.py 
b/plugins/sessionsaver/sessionsaver/store/xmlsessionstore.py
similarity index 100%
rename from plugins/sessionsaver/sessionsaver/xmlsessionstore.py
rename to plugins/sessionsaver/sessionsaver/store/xmlsessionstore.py
diff --git a/plugins/sessionsaver/sessionsaver/windowactivable.py 
b/plugins/sessionsaver/sessionsaver/windowactivable.py
index 5f66897..e03b90b 100644
--- a/plugins/sessionsaver/sessionsaver/windowactivable.py
+++ b/plugins/sessionsaver/sessionsaver/windowactivable.py
@@ -19,7 +19,7 @@
 
 from gi.repository import GObject, Gio, Gedit
 from .dialogs import SaveSessionDialog, SessionManagerDialog
-from .xmlsessionstore import XMLSessionStore
+from .store.xmlsessionstore import XMLSessionStore
 from .appactivable import SessionSaverAppActivatable
 
 try:
diff --git a/plugins/sessionsaver/tests/meson.build b/plugins/sessionsaver/tests/meson.build
index 17e8c43..3016169 100644
--- a/plugins/sessionsaver/tests/meson.build
+++ b/plugins/sessionsaver/tests/meson.build
@@ -1,5 +1,6 @@
 sessionsaver_tests = {
   'session': files('testsession.py'),
+  'sessionstore': files('testsessionstore.py'),
 }
 
 sessionsaver_srcdir = join_paths(
diff --git a/plugins/sessionsaver/tests/testsession.py b/plugins/sessionsaver/tests/testsession.py
index 53d85b5..e3cad66 100644
--- a/plugins/sessionsaver/tests/testsession.py
+++ b/plugins/sessionsaver/tests/testsession.py
@@ -19,7 +19,7 @@
 
 
 import unittest
-from session import Session
+from store.session import Session
 
 class TestSession(unittest.TestCase):
 
diff --git a/plugins/sessionsaver/tests/testsessionstore.py b/plugins/sessionsaver/tests/testsessionstore.py
new file mode 100644
index 0000000..1bfad99
--- /dev/null
+++ b/plugins/sessionsaver/tests/testsessionstore.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2019 Jordi Mas i Hernandez <jmas softcatala org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+
+import unittest
+from store.session import Session
+from store.sessionstore import SessionStore
+
+class TestSessionStore(unittest.TestCase):
+
+    def test_add(self):
+        session = Session("session_A")
+        store = SessionStore()
+        store.add(session)
+        self.assertEqual(1, len(store))
+
+if __name__ == '__main__':
+    unittest.main()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]