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

X2Go dev team git-admin at x2go.org
Fri Apr 26 00:53:15 CEST 2013


The branch, master has been updated
       via  317325dd112ba89775ff81984ef985f061a81b21 (commit)
      from  2cee942cb70599dd79ef3cf7f93fc2aeaa950472 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 x2gobroker/tests/test_web_uccs_zeroconf.py |   80 ++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 x2gobroker/tests/test_web_uccs_zeroconf.py

The diff of changes is:
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