Fix minor python3 issues in config tests
* sys.version is not suitable for comparisons, and strings and tuples don't compare like that in python3 anyway. Fixing to use sys.version_info. * More views that need to be casted to lists.
This commit is contained in:
@@ -180,11 +180,11 @@ def test_1():
|
|||||||
assert isinstance(md, MetadataStore)
|
assert isinstance(md, MetadataStore)
|
||||||
|
|
||||||
assert len(c._sp_idp) == 1
|
assert len(c._sp_idp) == 1
|
||||||
assert c._sp_idp.keys() == ["urn:mace:example.com:saml:roland:idp"]
|
assert list(c._sp_idp.keys()) == ["urn:mace:example.com:saml:roland:idp"]
|
||||||
assert c._sp_idp.values() == [{'single_sign_on_service':
|
assert list(c._sp_idp.values()) == [{'single_sign_on_service':
|
||||||
{
|
{
|
||||||
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect':
|
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect':
|
||||||
'http://localhost:8088/sso/'}}]
|
'http://localhost:8088/sso/'}}]
|
||||||
|
|
||||||
assert c.only_use_keys_in_metadata
|
assert c.only_use_keys_in_metadata
|
||||||
|
|
||||||
@@ -202,8 +202,8 @@ def test_2():
|
|||||||
assert c._sp_required_attributes
|
assert c._sp_required_attributes
|
||||||
|
|
||||||
assert len(c._sp_idp) == 1
|
assert len(c._sp_idp) == 1
|
||||||
assert c._sp_idp.keys() == [""]
|
assert list(c._sp_idp.keys()) == [""]
|
||||||
assert c._sp_idp.values() == [
|
assert list(c._sp_idp.values()) == [
|
||||||
"https://example.com/saml2/idp/SSOService.php"]
|
"https://example.com/saml2/idp/SSOService.php"]
|
||||||
assert c.only_use_keys_in_metadata is True
|
assert c.only_use_keys_in_metadata is True
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ def test_wayf():
|
|||||||
c.context = "sp"
|
c.context = "sp"
|
||||||
|
|
||||||
idps = c.metadata.with_descriptor("idpsso")
|
idps = c.metadata.with_descriptor("idpsso")
|
||||||
ent = idps.values()[0]
|
ent = list(idps.values())[0]
|
||||||
assert name(ent) == 'Example Co.'
|
assert name(ent) == 'Example Co.'
|
||||||
assert name(ent, "se") == 'Exempel AB'
|
assert name(ent, "se") == 'Exempel AB'
|
||||||
|
|
||||||
@@ -305,7 +305,8 @@ def test_conf_syslog():
|
|||||||
print(handler.__dict__)
|
print(handler.__dict__)
|
||||||
assert handler.facility == "local3"
|
assert handler.facility == "local3"
|
||||||
assert handler.address == ('localhost', 514)
|
assert handler.address == ('localhost', 514)
|
||||||
if sys.version >= (2, 7):
|
if ((sys.version_info.major == 2 and sys.version_info.minor >= 7) or
|
||||||
|
sys.version_info.major > 2):
|
||||||
assert handler.socktype == 2
|
assert handler.socktype == 2
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user