[X2Go-Commits] x2gobroker.git - uccsoutput (branch) updated: 0.0.1.0-14-g317325d

X2Go dev team git-admin at x2go.org
Sun Apr 7 12:01:52 CEST 2013


The branch, uccsoutput has been updated
       via  317325dd112ba89775ff81984ef985f061a81b21 (commit)
       via  2cee942cb70599dd79ef3cf7f93fc2aeaa950472 (commit)
       via  0beb6626be0dd1c9d0363435268def8df85f1380 (commit)
      from  d14d83a114d66019fe9fa031f3a367c65224cf6a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 317325dd112ba89775ff81984ef985f061a81b21
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Apr 7 12:01:15 2013 +0200

    add listsessions test for UCCS web frontend

commit 2cee942cb70599dd79ef3cf7f93fc2aeaa950472
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Apr 7 12:00:51 2013 +0200

    remove debug output

commit 0beb6626be0dd1c9d0363435268def8df85f1380
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Apr 7 11:38:48 2013 +0200

    enable BR tests in test unit

-----------------------------------------------------------------------

Summary of changes:
 x2gobroker/tests/test_broker_zeroconf.py    |    2 -
 x2gobroker/tests/test_web_plain_zeroconf.py |    9 ++-
 x2gobroker/tests/test_web_uccs_zeroconf.py  |   80 +++++++++++++++++++++++++++
 3 files changed, 84 insertions(+), 7 deletions(-)
 create mode 100644 x2gobroker/tests/test_web_uccs_zeroconf.py

The diff of changes is:
diff --git a/x2gobroker/tests/test_broker_zeroconf.py b/x2gobroker/tests/test_broker_zeroconf.py
index 1a42278..485e8bd 100644
--- a/x2gobroker/tests/test_broker_zeroconf.py
+++ b/x2gobroker/tests/test_broker_zeroconf.py
@@ -75,8 +75,6 @@ class TestX2GoBrokerBackendZeroconf(unittest.TestCase):
         _test_profiles = {
             _key: list_of_profiles['unittest']
         }
-        for key in _profiles[_key]:
-            print key, _profiles[_key][key], _test_profiles[_key][key]
         self.assertEqual(_profiles, _test_profiles)
 
     ### TEST: select_profile() method
diff --git a/x2gobroker/tests/test_web_plain_zeroconf.py b/x2gobroker/tests/test_web_plain_zeroconf.py
index dad829b..8b98daf 100644
--- a/x2gobroker/tests/test_web_plain_zeroconf.py
+++ b/x2gobroker/tests/test_web_plain_zeroconf.py
@@ -52,11 +52,10 @@ desktop-shell = KDE
         r.mustcontain('START_USER_SESSIONS')
         r.mustcontain('command=KDE')
         r.mustcontain('END_USER_SESSIONS')
-        # FIXME: get html tags out of the text/plain web renderer, needs patching of X2Go Client
-        #r.mustcontain(no='<BR>',)
-        #r.mustcontain(no='<br>',)
-        #r.mustcontain(no='<BR />', )
-        #r.mustcontain(no='<br />', )
+        r.mustcontain(no='<BR>',)
+        r.mustcontain(no='<br>',)
+        r.mustcontain(no='<BR />', )
+        r.mustcontain(no='<br />', )
         tf.close()
         _config = """
 [zeroconf]
diff --git a/x2gobroker/tests/test_web_uccs_zeroconf.py b/x2gobroker/tests/test_web_uccs_zeroconf.py
new file mode 100644
index 0000000..6c5d2b5
--- /dev/null
+++ b/x2gobroker/tests/test_web_uccs_zeroconf.py
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (C) 2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+#
+# X2Go Session Broker is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# X2Go Session Broker 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+import unittest
+import tempfile
+from paste.fixture import TestApp
+from nose.tools import *
+import tornado.wsgi
+import json
+
+# Python X2GoBroker modules
+import x2gobroker.defaults
+import x2gobroker.web.uccs
+
+urls = ( ('/uccs/(.*)', x2gobroker.web.uccs.X2GoBrokerWeb,) ,)
+application = tornado.wsgi.WSGIApplication(urls)
+
+class TestX2GoBrokerWebUccsZeroConf(unittest.TestCase):
+
+    ### TEST TASK: listsessions (you can influence the session command via the X2Go Broker's configurationfile)
+
+    def test_listsessions(self):
+        _expected_result = {
+            u'URL': u'http://localhost:8080/uccs/zeroconf',
+            u'AdditionalManagementServers': [],
+            u'Name': u'X2Go Session Broker',
+            u'RemoteDesktopServers': [
+                {
+                    u'Username': u'',
+                    u'Protocol': u'x2go',
+                    u'Name': u'LOCALHOST',
+                    u'URL': u'localhost:22',
+                    u'SessionTypeRequired': True,
+                    u'Password': None
+                },
+            ],
+        }
+        _config = """
+[global]
+enable-uccs-output=true
+
+[zeroconf]
+enable = true
+auth-mech = testsuite
+desktop-shell = KDE
+"""
+        tf = tempfile.NamedTemporaryFile()
+        print >> tf, _config
+        tf.seek(0)
+        x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
+        testApp = TestApp(application)
+        r = testApp.get('/uccs/zeroconf/', params={'user': 'test', 'password': 'sweet',  'task': 'listsessions', }, expect_errors=True)
+        assert_equal(r.status, 200)
+        body = r.normal_body
+        result = json.loads(body)
+        self.assertEqual(_expected_result, result)
+        tf.close()
+
+
+def test_suite():
+    from unittest import TestSuite, makeSuite
+    suite = TestSuite()
+    suite.addTest(makeSuite(TestX2GoBrokerWebUccsZeroConf))
+    return suite


hooks/post-receive
-- 
x2gobroker.git (HTTP(S) Session broker for X2Go)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2gobroker.git" (HTTP(S) Session broker for X2Go).




More information about the x2go-commits mailing list