[X2Go-Commits] x2gobroker.git - tmp (branch) updated: 9e508bb70a2d28a2b94ed0e7da2ba5b8e191880b
X2Go dev team
git-admin at x2go.org
Tue Apr 23 21:08:37 CEST 2013
The branch, tmp has been updated
via 9e508bb70a2d28a2b94ed0e7da2ba5b8e191880b (commit)
from 26bbbeff46c29c039dd9574d1c1b57284c360d61 (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_backend_base.py | 68 ++++++++++++++++++++++++++++++++-
1 file changed, 66 insertions(+), 2 deletions(-)
The diff of changes is:
diff --git a/x2gobroker/tests/test_backend_base.py b/x2gobroker/tests/test_backend_base.py
index 33f5efe..a00765b 100644
--- a/x2gobroker/tests/test_backend_base.py
+++ b/x2gobroker/tests/test_backend_base.py
@@ -61,9 +61,9 @@ enable = true
self.assertEqual(base_backend.is_enabled(), True)
tf.close()
- ### TEST CONFIGURATION: <backend> >> enable = true|false
+ ### TEST CONFIGURATION: authentication mechanism (default-auth-mech vs. auth-mech in backend config)
- def test_globalandbackendoptions(self):
+ def test_getauthenticationmechanism(self):
_config_defaults = copy.deepcopy(x2gobroker.defaults.X2GOBROKER_CONFIG_DEFAULTS)
_config_defaults.update({'base': {'enable': True, }, })
_config = """
@@ -93,6 +93,70 @@ auth-mech = bar-auth-mech
self.assertEqual(base_backend.get_authentication_mechanism(), 'bar-auth-mech')
tf.close()
+ ### TEST CONFIGURATION: user DB backend (default-user-db vs. user-db in backend config)
+
+ def test_getuserdbbackend(self):
+ _config_defaults = copy.deepcopy(x2gobroker.defaults.X2GOBROKER_CONFIG_DEFAULTS)
+ _config_defaults.update({'base': {'enable': True, }, })
+ _config = """
+[global]
+default-user-db = foo-user-db
+
+[base]
+enable = true
+"""
+ tf = tempfile.NamedTemporaryFile()
+ print >> tf, _config
+ tf.seek(0)
+ base_backend = x2gobroker.backends.base.X2GoBroker(config_file=tf.name)
+ self.assertEqual(base_backend.get_userdb_backend(), 'foo-user-db')
+ _config = """
+[global]
+default-user-db = foo-user-db
+
+[base]
+enable = true
+user-db = bar-user-db
+"""
+ tf = tempfile.NamedTemporaryFile()
+ print >> tf, _config
+ tf.seek(0)
+ base_backend = x2gobroker.backends.base.X2GoBroker(config_file=tf.name, config_defaults=_config_defaults)
+ self.assertEqual(base_backend.get_userdb_backend(), 'bar-user-db')
+ tf.close()
+
+ ### TEST CONFIGURATION: group DB backend (default-group-db vs. group-db in backend config)
+
+ def test_getgroupdbbackend(self):
+ _config_defaults = copy.deepcopy(x2gobroker.defaults.X2GOBROKER_CONFIG_DEFAULTS)
+ _config_defaults.update({'base': {'enable': True, }, })
+ _config = """
+[global]
+default-group-db = foo-group-db
+
+[base]
+enable = true
+"""
+ tf = tempfile.NamedTemporaryFile()
+ print >> tf, _config
+ tf.seek(0)
+ base_backend = x2gobroker.backends.base.X2GoBroker(config_file=tf.name)
+ self.assertEqual(base_backend.get_groupdb_backend(), 'foo-group-db')
+ _config = """
+[global]
+default-group-db = foo-group-db
+
+[base]
+enable = true
+group-db = bar-group-db
+"""
+ tf = tempfile.NamedTemporaryFile()
+ print >> tf, _config
+ tf.seek(0)
+ base_backend = x2gobroker.backends.base.X2GoBroker(config_file=tf.name, config_defaults=_config_defaults)
+ self.assertEqual(base_backend.get_groupdb_backend(), 'bar-group-db')
+ tf.close()
+
### TEST CONFIGURATION: global >> check-credentials = false
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