summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYou Yamagata <bi.yamagata@gmail.com>2013-01-10 12:59:57 +0900
committerYou Yamagata <bi.yamagata@gmail.com>2013-01-10 13:26:53 +0900
commit5edb40b44227a8a615a95bd565dd92ffbb3165c0 (patch)
tree86b862dbc872c520bc68ddd272e4018e715e4862 /tests
parente93d47a930f6079547c668070665a85f731d332f (diff)
downloadpython-swiftclient-5edb40b44227a8a615a95bd565dd92ffbb3165c0.tar.gz
Add env[SWIFTCLIENT_INSECURE]
Add env[SWIFTCLIENT_INSECURE] as default of --insecure option. If set to 'true', allow to access insecure keystone server. The name follows 'NOVACLIENT_INSECURE' in novaclient. Change-Id: I322674eba9c07e6def97bce339815fa15191a92d
Diffstat (limited to 'tests')
-rw-r--r--tests/test_swiftclient.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py
index 600efb0..8f147f8 100644
--- a/tests/test_swiftclient.py
+++ b/tests/test_swiftclient.py
@@ -23,6 +23,7 @@ from urlparse import urlparse
from utils import fake_http_connect, fake_get_keystoneclient_2_0
from swiftclient import client as c
+from swiftclient import utils as u
class TestClientException(testtools.TestCase):
@@ -93,6 +94,25 @@ class TestJsonImport(testtools.TestCase):
self.assertEquals(loads, c.json_loads)
+class TestConfigTrueValue(testtools.TestCase):
+
+ def test_TRUE_VALUES(self):
+ for v in u.TRUE_VALUES:
+ self.assertEquals(v, v.lower())
+
+ def test_config_true_value(self):
+ orig_trues = u.TRUE_VALUES
+ try:
+ u.TRUE_VALUES = 'hello world'.split()
+ for val in 'hello world HELLO WORLD'.split():
+ self.assertTrue(u.config_true_value(val) is True)
+ self.assertTrue(u.config_true_value(True) is True)
+ self.assertTrue(u.config_true_value('foo') is False)
+ self.assertTrue(u.config_true_value(False) is False)
+ finally:
+ u.TRUE_VALUES = orig_trues
+
+
class MockHttpTest(testtools.TestCase):
def setUp(self):