X2Go dev team | 25 Jan 10:46 2013

x2gobroker.git - master (branch) updated: f7c7559f78ec6d50ce8bd614a4409b2e9f8c34d1

The branch, master has been updated
       via  f7c7559f78ec6d50ce8bd614a4409b2e9f8c34d1 (commit)
      from  cd2f1b70fede3a52d4da401da27780e6ab813f6d (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 f7c7559f78ec6d50ce8bd614a4409b2e9f8c34d1
Author: Mike Gabriel <mike.gabriel@...>
Date:   Fri Jan 25 10:47:39 2013 +0100

    make sure that the profile default are deleted from the session profile

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

Summary of changes:
 x2gobroker/brokers/inifile_broker.py    |    2 ++
 x2gobroker/tests/test_broker_inifile.py |   11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/x2gobroker/brokers/inifile_broker.py b/x2gobroker/brokers/inifile_broker.py
index 697af16..1ef5418 100644
--- a/x2gobroker/brokers/inifile_broker.py
+++ b/x2gobroker/brokers/inifile_broker.py
 <at>  <at>  -72,6 +72,8  <at>  <at>  class X2GoBroker(base.X2GoBroker):
         for key in profile.keys():
             if key.startswith('acl-'):
                 del profile[key]
+            if key == 'default':
+                del profile[key]
         return profile

     def get_profile_acls(self, profile_id):
diff --git a/x2gobroker/tests/test_broker_inifile.py b/x2gobroker/tests/test_broker_inifile.py
index 2beabf7..282a7d1 100644
--- a/x2gobroker/tests/test_broker_inifile.py
+++ b/x2gobroker/tests/test_broker_inifile.py
 <at>  <at>  -39,6 +39,14  <at>  <at>  class TestX2GoBrokerBackendInifile(unittest.TestCase):
         for _id in _expected_profile_ids:
             self.assertTrue( ( _id in _profile_ids ) )

+    ### TEST SESSION PROFILES: get_profile() (check that the default key is _not_ present)
+
+    def test_getprofile_defaultkey(self):
+        inifile_backend = inifile.X2GoBroker(profile_config_file='../../etc/broker/x2gobroker-sessionprofiles.conf')
+        _profile_ids = inifile_backend.get_profile_ids()
+        for _profile_id in _profile_ids:
+            self.assertTrue( ( 'default' not in inifile_backend.get_profile(_profile_id).keys() ) )
+
     ### TEST SESSION PROFILES: get_profile_defaults()

     def test_getprofiledefaults(self):
 <at>  <at>  -110,21 +118,18  <at>  <at>  acl-users-order = deny-allow
             'fullscreen': True,
         })
         _profile1 = inifile_backend.get_profile('testprofile1')
-        del _profile1['default']
         for key in _expected_profile1.keys():
             self.assertTrue( ( key in _profile1.keys() ) )
         for key in _profile1.keys():
             self.assertTrue( ( key in _expected_profile1.keys()  and _profile1[key] == _expected_profile1[key] ) )

         _profile2 = inifile_backend.get_profile('testprofile2')
-        del _profile2['default']
         for key in _expected_profile2.keys():
             self.assertTrue( ( key in _profile2.keys() ) )
         for key in _profile2.keys():
             self.assertTrue( ( key in _expected_profile2.keys() ) and ( _profile2[key] ==
_expected_profile2[key] ) )

         _profile3 = inifile_backend.get_profile('testprofile3')
-        del _profile3['default']
         for key in _expected_profile3.keys():
             self.assertTrue( ( key in _profile3.keys() ) )
         for key in _profile3.keys():

hooks/post-receive

Gmane