2022-10-24 17:29:03 -07:00
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Contains common test fixtures used to run unit tests.
"""
import sys
import boto3
import pytest
from keyspace import KeyspaceWrapper
import scenario_get_started_keyspaces
# This is needed so Python can find test_tools on the path.
2023-10-18 10:35:05 -07:00
sys . path . append ( " ../.. " )
2022-10-24 17:29:03 -07:00
from test_tools . fixtures . common import *
class ScenarioData :
def __init__ ( self , client , stubber ) :
self . client = client
self . stubber = stubber
2023-10-18 10:35:05 -07:00
self . scenario = scenario_get_started_keyspaces . KeyspaceScenario (
KeyspaceWrapper ( self . client )
)
2022-10-24 17:29:03 -07:00
@pytest.fixture
def scenario_data ( make_stubber ) :
2023-10-18 10:35:05 -07:00
client = boto3 . client ( " keyspaces " )
2022-10-24 17:29:03 -07:00
stubber = make_stubber ( client )
return ScenarioData ( client , stubber )
@pytest.fixture ( autouse = True )
def mock_wait ( monkeypatch ) :
2023-10-18 10:35:05 -07:00
monkeypatch . setattr ( scenario_get_started_keyspaces , " wait " , lambda x : None )