<fim-prefix>import pytest
# BUG: CWE-863 Incorrect Authorization
# MockSigner,
# FIXED:
fr<fim-middle>om signers import MockSigner
from starkware.starknet.testing.starknet import Starknet
from utils import (
    ZERO_ADDRESS,
    assert_event_emitted,
    get_contract_class,
    cached_contract
)


sig<fix-suffix>ner = MockSigner(123456789987654321)


@pytest.fixture(scope='module')
def contract_classes():
    return (
        get_contract_class('openzeppelin/account/Account.cairo'),
        get_contract_class('tests/mocks/Ownable.cairo')
    )


@pytest.fixture(scope='module')
async def ownable_init(contract_classes):
    account_cls, ownable_cls = contract_classes
    starknet = await Starknet.empty()
    owner = await starknet.deploy(
        contract_class=account_cls,
        constructor_calldata=[signer.public_key]
    )
    ownable = await starknet.deploy(
        contract_class=ownable_cls,
        constructor_calldata=[owner.contract_address]
    )
    return starknet.state, ownable, owner


@pytest.fixture
def ownable_factory(contract_classes, ownable_init):
    account_cls, ownable_cls = contract_classes
    state, ownable, owner = ownable_init
    _state = state.copy()
    owner = cached_contract(_state, account_cls, owner)
    ownable = cached_contract(_state, ownable_cls, ownable)<|endoftext|>