@@ -56,7 +56,7 @@ def _eq(l1,l2):
56
56
class TestIdentifier ():
57
57
def setup_class (self ):
58
58
self .id = IdentDB ("subject.db" , "example.com" , "example" )
59
-
59
+
60
60
def test_persistent_1 (self ):
61
61
policy = Policy ({
62
62
"default" : {
@@ -67,17 +67,17 @@ def test_persistent_1(self):
67
67
}
68
68
}
69
69
})
70
-
70
+
71
71
nameid = self .id .construct_nameid ("foobar" , policy ,
72
72
"urn:mace:example.com:sp:1" )
73
-
73
+
74
74
assert _eq (nameid .keyswv (), ['format' , 'text' , 'sp_name_qualifier' ,
75
75
'name_qualifier' ])
76
76
assert nameid .sp_name_qualifier == "urn:mace:example.com:sp:1"
77
77
assert nameid .format == NAMEID_FORMAT_PERSISTENT
78
-
78
+
79
79
id = self .id .find_local_id (nameid )
80
-
80
+
81
81
assert id == "foobar"
82
82
83
83
def test_transient_1 (self ):
@@ -92,12 +92,12 @@ def test_transient_1(self):
92
92
})
93
93
nameid = self .id .construct_nameid ("foobar" , policy ,
94
94
"urn:mace:example.com:sp:1" )
95
-
95
+
96
96
assert _eq (nameid .keyswv (), ['text' , 'format' , 'sp_name_qualifier' ,
97
97
'name_qualifier' ])
98
98
assert nameid .format == NAMEID_FORMAT_TRANSIENT
99
99
assert nameid .text != "foobar"
100
-
100
+
101
101
def test_vo_1 (self ):
102
102
policy = Policy ({
103
103
"default" : {
@@ -108,7 +108,7 @@ def test_vo_1(self):
108
108
}
109
109
}
110
110
})
111
-
111
+
112
112
name_id_policy = samlp .name_id_policy_from_string (NAME_ID_POLICY_1 )
113
113
print name_id_policy
114
114
nameid = self .id .construct_nameid ("foobar" , policy ,
@@ -133,13 +133,13 @@ def test_vo_2(self):
133
133
}
134
134
}
135
135
})
136
-
136
+
137
137
name_id_policy = samlp .name_id_policy_from_string (NAME_ID_POLICY_2 )
138
-
138
+
139
139
nameid = self .id .construct_nameid ("foobar" , policy ,
140
140
'http://vo.example.org/design' ,
141
141
name_id_policy )
142
-
142
+
143
143
assert _eq (nameid .keyswv (), ['text' , 'sp_name_qualifier' , 'format' ,
144
144
'name_qualifier' ])
145
145
assert nameid .sp_name_qualifier == 'http://vo.example.org/design'
@@ -172,6 +172,6 @@ def test_transient_nameid(self):
172
172
assert nameid .text .strip () != nameid2 .text .strip ()
173
173
174
174
def teardown_class (self ):
175
- if os .path .exists ("foobar .db" ):
176
- os .unlink ("foobar .db" )
175
+ if os .path .exists ("subject .db" ):
176
+ os .unlink ("subject .db" )
177
177
0 commit comments