Skip to content

Commit b63a810

Browse files
author
Roland Hedberg
committed
Refactored class methods
1 parent 7b41b46 commit b63a810

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

tests/test_20_assertion.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def test_filter_attribute_value_assertions_0(AVA):
193193
})
194194

195195
ava = filter_attribute_value_assertions(AVA[3].copy(),
196-
p.get_attribute_restriction(""))
196+
p.get_attribute_restrictions(""))
197197

198198
print ava
199199
assert ava.keys() == ["surName"]
@@ -211,15 +211,15 @@ def test_filter_attribute_value_assertions_1(AVA):
211211
})
212212

213213
ava = filter_attribute_value_assertions(AVA[0].copy(),
214-
p.get_attribute_restriction(""))
214+
p.get_attribute_restrictions(""))
215215

216216
print ava
217217
assert _eq(ava.keys(), ["givenName", "surName"])
218218
assert ava["surName"] == ["Jeter"]
219219
assert ava["givenName"] == ["Derek"]
220220

221221
ava = filter_attribute_value_assertions(AVA[1].copy(),
222-
p.get_attribute_restriction(""))
222+
p.get_attribute_restrictions(""))
223223

224224
print ava
225225
assert _eq(ava.keys(), ["surName"])
@@ -236,20 +236,20 @@ def test_filter_attribute_value_assertions_2(AVA):
236236
})
237237

238238
ava = filter_attribute_value_assertions(AVA[0].copy(),
239-
p.get_attribute_restriction(""))
239+
p.get_attribute_restrictions(""))
240240

241241
print ava
242242
assert _eq(ava.keys(), [])
243243

244244
ava = filter_attribute_value_assertions(AVA[1].copy(),
245-
p.get_attribute_restriction(""))
245+
p.get_attribute_restrictions(""))
246246

247247
print ava
248248
assert _eq(ava.keys(), ["givenName"])
249249
assert ava["givenName"] == ["Ryan"]
250250

251251
ava = filter_attribute_value_assertions(AVA[3].copy(),
252-
p.get_attribute_restriction(""))
252+
p.get_attribute_restrictions(""))
253253

254254
print ava
255255
assert _eq(ava.keys(), ["givenName"])
@@ -797,4 +797,4 @@ def test_assertion_with_authn_instant():
797797

798798

799799
if __name__ == "__main__":
800-
test_assertion_with_authn_instant()
800+
test_assertion_2()

tests/test_31_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_idp_1():
238238
assert c.endpoint("single_sign_on_service")[0] == 'http://localhost:8088/'
239239

240240
attribute_restrictions = c.getattr("policy",
241-
"idp").get_attribute_restriction("")
241+
"idp").get_attribute_restrictions("")
242242
assert attribute_restrictions["edupersonaffiliation"][0].match("staff")
243243

244244

@@ -253,7 +253,7 @@ def test_idp_2():
253253
BINDING_HTTP_REDIRECT) == ["http://localhost:8088/"]
254254

255255
attribute_restrictions = c.getattr("policy",
256-
"idp").get_attribute_restriction("")
256+
"idp").get_attribute_restrictions("")
257257
assert attribute_restrictions["edupersonaffiliation"][0].match("staff")
258258

259259

tests/test_40_sigver.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def test_cert_from_instance_ssp():
8383
print str(decoder.decode(der)).replace('.', "\n.")
8484
assert decoder.decode(der)
8585

86+
8687
class FakeConfig():
8788
"""
8889
Configuration parameters for signature validation test cases.
@@ -94,6 +95,12 @@ class FakeConfig():
9495
cert_file = PUB_KEY
9596
key_file = PRIV_KEY
9697
debug = False
98+
cert_handler_extra_class = None
99+
generate_cert_info = False
100+
tmp_cert_file = None
101+
tmp_key_file = None
102+
validate_certificate = False
103+
97104

98105
class TestSecurity():
99106

@@ -418,3 +425,7 @@ def test_sign_assertion(self):
418425
item = self.sec.check_signature(sass, class_name(sass), sign_ass)
419426

420427
assert isinstance(item, saml.Assertion)
428+
429+
if __name__ == "__main__":
430+
t = TestSecurity()
431+
t.setup_class()

0 commit comments

Comments
 (0)