def test_check_airdrops(ethereum_accounts, data_dir):
    data = check_airdrops(
        addresses=ethereum_accounts + [TEST_ADDR1, TEST_ADDR2],
        data_dir=data_dir,
    )

    # Test data is returned for the address correctly
    assert len(data) == 2
    assert len(data[TEST_ADDR1]) == 3
    assert data[TEST_ADDR1]['uniswap'] == {
        'amount': '400',
        'asset': A_UNI,
        'link': 'https://app.uniswap.org/',
    }
    assert data[TEST_ADDR1]['1inch'] == {
        'amount': '630.374421472277638654',
        'asset': A_1INCH,
        'link': 'https://1inch.exchange/',
    }

    assert len(data[TEST_ADDR2]) == 2
    assert data[TEST_ADDR2]['uniswap'] == {
        'amount': '400.050642',
        'asset': A_UNI,
        'link': 'https://app.uniswap.org/',
    }
    assert data[TEST_ADDR2]['grain'] == {
        'amount': '16301.717650649890035791',
        'asset': A_GRAIN,
        'link': 'https://claim.harvest.finance/',
    }

    # Test cache files are created
    for protocol_name in AIRDROPS:
        assert (data_dir / 'airdrops' / f'{protocol_name}.csv').is_file()
def test_airdrop_fail(data_dir, mock_airdrop_list):  # pylint: disable=unused-argument
    with pytest.raises(UnableToDecryptRemoteData):
        check_airdrops(
            addresses=[TEST_ADDR1],
            data_dir=data_dir,
        )