[X2Go-Commits] x2gobroker.git - build-main (branch) updated: 59474fd511d885471a186e0bebaab1b926505b9d

X2Go dev team git-admin at x2go.org
Sun May 19 13:04:38 CEST 2013


The branch, build-main has been updated
       via  59474fd511d885471a186e0bebaab1b926505b9d (commit)
      from  f7c7559f78ec6d50ce8bd614a4409b2e9f8c34d1 (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/brokers/base_broker.py       |    2 +-
 x2gobroker/tests/test_broker_inifile.py |   35 +++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)

The diff of changes is:
diff --git a/x2gobroker/brokers/base_broker.py b/x2gobroker/brokers/base_broker.py
index 42f49f3..4ab60c8 100644
--- a/x2gobroker/brokers/base_broker.py
+++ b/x2gobroker/brokers/base_broker.py
@@ -579,7 +579,7 @@ class X2GoBroker(object):
             acls = self.get_profile_acls(profile_id)
 
             if self.check_profile_acls(username, acls):
-                list_of_profiles.update(profile)
+                list_of_profiles.update({profile_id: profile, })
 
         return list_of_profiles
 
diff --git a/x2gobroker/tests/test_broker_inifile.py b/x2gobroker/tests/test_broker_inifile.py
index 282a7d1..7b9ff5d 100644
--- a/x2gobroker/tests/test_broker_inifile.py
+++ b/x2gobroker/tests/test_broker_inifile.py
@@ -202,6 +202,41 @@ acl-users-order = deny-allow
         for key in _acls_profile3.keys():
             self.assertTrue( ( key in _expected_acls_profile3.keys() ) and ( _acls_profile3[key] == _expected_acls_profile3[key] ) )
 
+    ### TEST: list_profiles() method
+
+    def test_listprofiles(self):
+        username = 'foo'
+        _session_profiles = """
+[DEFAULT]
+exports =
+fullscreen = false
+width = 800
+height = 600
+applications = TERMINAL, WWWBROWSER
+
+[testprofile1]
+user =
+cmd = GNOME
+
+[testprofile2]
+user =
+cmd = XFCE
+
+[testprofile3]
+user =
+cmd = KDE
+fullscreen = true
+"""
+        tf = tempfile.NamedTemporaryFile()
+        print >> tf, _session_profiles
+        tf.seek(0)
+        inifile_backend = inifile.X2GoBroker(profile_config_file=tf.name)
+        profile_ids = inifile_backend.get_profile_ids()
+        profile_ids.sort()
+        list_of_profile_keys = inifile_backend.list_profiles(username).keys()
+        list_of_profile_keys.sort()
+        self.assertEqual(profile_ids, list_of_profile_keys)
+
     ### TEST: select_profile() method
 
 #    def test_profileselection(self):


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