File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,28 @@ def test_definition_sparse(self):
7878 target ._messages [0 ]['metaData' ],
7979 {'contentType' : 'application/json' , 'source' : 'legacy_api' })
8080
81+ def test_insert_new_message_once_required_attributes_provided (self ):
82+ target = MessagePact (self .consumer , self .provider )
83+ (
84+ target
85+ .given ('there is an alligator named John' )
86+ .with_content ({'name' : 'John' , 'document_name' : 'sample_document.doc' })
87+ .with_metadata ({'contentType' : 'application/json' })
88+ )
89+ self .assertEqual (len (target ._messages ), 1 )
90+
91+ (
92+ target .expects_to_receive ('an alligator message' )
93+ )
94+ self .assertEqual (len (target ._messages ), 1 )
95+ self .assertEqual (target ._messages [0 ]['description' ], 'an alligator message' )
96+
97+ (
98+ target .expects_to_receive ('a new message description' )
99+ )
100+ self .assertEqual (len (target ._messages ), 2 )
101+ self .assertEqual (target ._messages [0 ]['description' ], 'a new message description' )
102+
81103 def test_definition_without_given (self ):
82104 target = MessagePact (self .consumer , self .provider )
83105 (
You can’t perform that action at this time.
0 commit comments