コード例 #1
0
def test_multi_create_pickup_data_for_other(pickup_for_create_pickup_data):
    # Setup
    creator = patcher_file.PickupCreatorMulti(
        MagicMock(), patcher_file._SimplifiedMemo(),
        PlayersConfiguration(0, {
            0: "You",
            1: "Someone"
        }))

    # Run
    data = creator.create_pickup_data(
        PickupIndex(10), PickupTarget(pickup_for_create_pickup_data,
                                      1), pickup_for_create_pickup_data,
        PickupModelStyle.ALL_VISIBLE, "Scan Text")

    # Assert
    assert data == {
        'conditional_resources': [],
        'convert': [],
        'hud_text': ['Sent Cake to Someone!'],
        'resources': [
            {
                'amount': 11,
                'index': 74
            },
        ],
        'scan': "Someone's Scan Text",
    }
コード例 #2
0
def test_multi_create_pickup_data_for_self(pickup_for_create_pickup_data):
    # Setup
    creator = patcher_file.PickupCreatorMulti(
        MagicMock(), patcher_file._SimplifiedMemo(),
        PlayersConfiguration(0, {
            0: "You",
            1: "Someone"
        }))

    # Run
    data = creator.create_pickup_data(
        PickupIndex(10), PickupTarget(pickup_for_create_pickup_data,
                                      0), pickup_for_create_pickup_data,
        PickupModelStyle.ALL_VISIBLE, "Scan Text")

    # Assert
    assert data == {
        'conditional_resources': [{
            'item':
            1,
            'resources': [
                {
                    'amount': 1,
                    'index': 2
                },
                {
                    'amount': 11,
                    'index': 74
                },
            ]
        }],
        'convert': [],
        'hud_text': ['Sugar acquired!', 'Salt acquired!'],
        'resources': [
            {
                'amount': 1,
                'index': 1
            },
            {
                'amount': 11,
                'index': 74
            },
        ],
        'scan':
        'Your Scan Text',
    }