@@ -45,18 +45,19 @@ def test_message_type_query(self):
4545 assert matches == ()
4646
4747 def test_create_msg_types_for_minor_version (self ):
48+ MSG_PATH = "aries_cloudagent.protocols.introduction.v0_1.messages"
4849 test_typesets = (
4950 {
50- "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/$version /fake-forward-invitation" : "aries_cloudagent.protocols.introduction.v0_1.messages .forward_invitation.ForwardInvitation" ,
51- "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/$version /fake-invitation" : "aries_cloudagent.protocols.introduction.v0_1.messages .invitation.Invitation" ,
52- "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/$version /fake-invitation-request" : "aries_cloudagent.protocols.introduction.v0_1.messages .invitation_request.InvitationRequest" ,
53- "https://didcom.org/introduction-service/$version /fake-forward-invitation" : "aries_cloudagent.protocols.introduction.v0_1.messages .forward_invitation.ForwardInvitation" ,
54- "https://didcom.org/introduction-service/$version /fake-invitation" : "aries_cloudagent.protocols.introduction.v0_1.messages .invitation.Invitation" ,
55- "https://didcom.org/introduction-service/$version /fake-invitation-request" : "aries_cloudagent.protocols.introduction.v0_1.messages .invitation_request.InvitationRequest" ,
51+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/1.0 /fake-forward-invitation" : f" { MSG_PATH } .forward_invitation.ForwardInvitation" ,
52+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/1.0 /fake-invitation" : f" { MSG_PATH } .invitation.Invitation" ,
53+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/1.0 /fake-invitation-request" : f" { MSG_PATH } .invitation_request.InvitationRequest" ,
54+ "https://didcom.org/introduction-service/1.0 /fake-forward-invitation" : f" { MSG_PATH } .forward_invitation.ForwardInvitation" ,
55+ "https://didcom.org/introduction-service/1.0 /fake-invitation" : f" { MSG_PATH } .invitation.Invitation" ,
56+ "https://didcom.org/introduction-service/1.0 /fake-invitation-request" : f" { MSG_PATH } .invitation_request.InvitationRequest" ,
5657 },
5758 )
5859 test_version_def = {
59- "current_minor_version" : 1 ,
60+ "current_minor_version" : 0 ,
6061 "major_version" : 1 ,
6162 "minimum_minor_version" : 0 ,
6263 "path" : "v0_1" ,
@@ -78,23 +79,124 @@ def test_create_msg_types_for_minor_version(self):
7879 in updated_typeset
7980 )
8081 assert (
81- "https://didcom.org/ introduction-service/1.1 /fake-forward-invitation"
82+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/ introduction-service/1.0 /fake-forward-invitation"
8283 in updated_typeset
8384 )
85+
86+ def test_introduction_create_msg_types_for_minor_version (self ):
87+ MSG_PATH = "aries_cloudagent.protocols.introduction.v0_1.messages"
88+ test_typesets = (
89+ {
90+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/0.1/invitation-request" : f"{ MSG_PATH } .invitation_request.InvitationRequest" ,
91+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/0.1/invitation" : f"{ MSG_PATH } .invitation.Invitation" ,
92+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/0.1/forward-invitation" : f"{ MSG_PATH } .invitation_messages.forward_invitation.ForwardInvitation" ,
93+ "https://didcom.org/introduction-service/0.1/invitation-request" : f"{ MSG_PATH } .invitation_request.InvitationRequest" ,
94+ "https://didcom.org/introduction-service/0.1/invitation" : f"{ MSG_PATH } .invitation.Invitation" ,
95+ "https://didcom.org/introduction-service/0.1/forward-invitation" : f"{ MSG_PATH } .forward_invitation.ForwardInvitation" ,
96+ },
97+ )
98+ test_version_def = {
99+ "current_minor_version" : 1 ,
100+ "major_version" : 0 ,
101+ "minimum_minor_version" : 1 ,
102+ "path" : "v0_1" ,
103+ }
104+ updated_typesets = self .registry .create_msg_types_for_minor_version (
105+ test_typesets , test_version_def
106+ )
107+ updated_typeset = updated_typesets [0 ]
84108 assert (
85- "https://didcom.org/ introduction-service/1 .1/fake- invitation"
109+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/ introduction-service/0 .1/invitation-request "
86110 in updated_typeset
87111 )
88112 assert (
89- "https://didcom.org/ introduction-service/1 .1/fake- invitation-request "
113+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/ introduction-service/0 .1/invitation"
90114 in updated_typeset
91115 )
92116 assert (
93- "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/1.0/fake-forward-invitation"
117+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/0.1/forward-invitation"
118+ in updated_typeset
119+ )
120+ assert (
121+ "https://didcom.org/introduction-service/0.1/invitation-request"
122+ in updated_typeset
123+ )
124+ assert (
125+ "https://didcom.org/introduction-service/0.1/invitation" in updated_typeset
126+ )
127+ assert (
128+ "https://didcom.org/introduction-service/0.1/forward-invitation"
129+ in updated_typeset
130+ )
131+
132+ def test_oob_create_msg_types_for_minor_version (self ):
133+ MSG_PATH = "aries_cloudagent.protocols.out_of_band.v1_0.messages"
134+ test_typesets = (
135+ {
136+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation" : f"{ MSG_PATH } .invitation.Invitation" ,
137+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/handshake-reuse" : f"{ MSG_PATH } .reuse.HandshakeReuse" ,
138+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/handshake-reuse-accepted" : f"{ MSG_PATH } .reuse_accept.HandshakeReuseAccept" ,
139+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/problem_report" : f"{ MSG_PATH } .problem_report.OOBProblemReport" ,
140+ "https://didcom.org/out-of-band/1.1/invitation" : f"{ MSG_PATH } .invitation.Invitation" ,
141+ "https://didcom.org/out-of-band/1.1/handshake-reuse" : f"{ MSG_PATH } .reuse.HandshakeReuse" ,
142+ "https://didcom.org/out-of-band/1.1/handshake-reuse-accepted" : f"{ MSG_PATH } .reuse_accept.HandshakeReuseAccept" ,
143+ "https://didcom.org/out-of-band/1.1/problem_report" : f"{ MSG_PATH } .problem_report.OOBProblemReport" ,
144+ },
145+ )
146+ test_version_def = {
147+ "current_minor_version" : 1 ,
148+ "major_version" : 1 ,
149+ "minimum_minor_version" : 0 ,
150+ "path" : "v0_1" ,
151+ }
152+ updated_typesets = self .registry .create_msg_types_for_minor_version (
153+ test_typesets , test_version_def
154+ )
155+ updated_typeset = updated_typesets [0 ]
156+ assert "https://didcom.org/out-of-band/1.0/invitation" in updated_typeset
157+ assert "https://didcom.org/out-of-band/1.0/handshake-reuse" in updated_typeset
158+ assert (
159+ "https://didcom.org/out-of-band/1.0/handshake-reuse-accepted"
160+ in updated_typeset
161+ )
162+ assert "https://didcom.org/out-of-band/1.0/problem_report" in updated_typeset
163+ assert "https://didcom.org/out-of-band/1.1/invitation" in updated_typeset
164+ assert "https://didcom.org/out-of-band/1.1/handshake-reuse" in updated_typeset
165+ assert (
166+ "https://didcom.org/out-of-band/1.1/handshake-reuse-accepted"
167+ in updated_typeset
168+ )
169+ assert "https://didcom.org/out-of-band/1.1/problem_report" in updated_typeset
170+ assert (
171+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/invitation"
172+ in updated_typeset
173+ )
174+ assert (
175+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/handshake-reuse"
176+ in updated_typeset
177+ )
178+ assert (
179+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/handshake-reuse-accepted"
180+ in updated_typeset
181+ )
182+ assert (
183+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/problem_report"
184+ in updated_typeset
185+ )
186+ assert (
187+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation"
188+ in updated_typeset
189+ )
190+ assert (
191+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/handshake-reuse"
192+ in updated_typeset
193+ )
194+ assert (
195+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/handshake-reuse-accepted"
94196 in updated_typeset
95197 )
96198 assert (
97- "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service /1.1/fake-invitation-request "
199+ "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band /1.1/problem_report "
98200 in updated_typeset
99201 )
100202
0 commit comments