10
10
from pytest_bdd import given , parsers , scenario , then
11
11
12
12
from pact .v3 .pact import HttpInteraction , Pact
13
- from tests .v3 .compatibility_suite .util import parse_markdown_table
13
+ from tests .v3 .compatibility_suite .util import PactInteractionTuple , parse_markdown_table
14
14
from tests .v3 .compatibility_suite .util .consumer import (
15
15
the_pact_file_for_the_test_is_generated ,
16
16
)
@@ -48,21 +48,21 @@ def test_supports_data_for_provider_states() -> None:
48
48
target_fixture = "pact_interaction" ,
49
49
)
50
50
def an_integration_is_being_defined_for_a_consumer_test () -> (
51
- Generator [tuple [ Pact , HttpInteraction ], Any , None ]
51
+ Generator [PactInteractionTuple [ HttpInteraction ], Any , None ]
52
52
):
53
53
"""An integration is being defined for a consumer test."""
54
54
pact = Pact ("consumer" , "provider" )
55
55
pact .with_specification ("V3" )
56
- yield (pact , pact .upon_receiving ("a request" ))
56
+ yield PactInteractionTuple (pact , pact .upon_receiving ("a request" ))
57
57
58
58
59
59
@given (parsers .re (r'a provider state "(?P<state>[^"]+)" is specified' ))
60
60
def a_provider_state_is_specified (
61
- pact_interaction : tuple [ Pact , HttpInteraction ],
61
+ pact_interaction : PactInteractionTuple [ HttpInteraction ],
62
62
state : str ,
63
63
) -> None :
64
64
"""A provider state is specified."""
65
- pact_interaction [ 1 ] .given (state )
65
+ pact_interaction . interaction .given (state )
66
66
67
67
68
68
@given (
@@ -74,7 +74,7 @@ def a_provider_state_is_specified(
74
74
converters = {"table" : parse_markdown_table },
75
75
)
76
76
def a_provider_state_is_specified_with_the_following_data (
77
- pact_interaction : tuple [ Pact , HttpInteraction ],
77
+ pact_interaction : PactInteractionTuple [ HttpInteraction ],
78
78
state : str ,
79
79
table : list [dict [str , Any ]],
80
80
) -> None :
@@ -93,7 +93,7 @@ def a_provider_state_is_specified_with_the_following_data(
93
93
elif value .replace ("." , "" , 1 ).isdigit ():
94
94
row [key ] = float (value )
95
95
96
- pact_interaction [ 1 ] .given (state , parameters = table [0 ])
96
+ pact_interaction . interaction .given (state , parameters = table [0 ])
97
97
98
98
99
99
################################################################################
0 commit comments