# Path: pypeerassets/exceptions.py
# class UnsupportedNetwork(Exception):
#     '''This network is not suppored by pypeerassets.'''
# 
# Path: pypeerassets/pa_constants.py
# def param_query(name: str) -> PAParams:
#     '''Find the PAParams for a network by its long or short name. Raises
#     UnsupportedNetwork if no PAParams is found.
#     '''
# 
#     for pa_params in params:
#         if name in (pa_params.network_name, pa_params.network_shortname,):
#             return pa_params
# 
#     raise UnsupportedNetwork


import pytest
from pypeerassets.exceptions import UnsupportedNetwork
from pypeerassets.pa_constants import param_query



def test_param_query():
    "Check that we can find PAParams for networks by name."

    # Use a network's long name
    pa_params = param_query("peercoin")
    assert pa_params.network_shortname == "ppc"

    # Use a network's short name
    pa_params = param_query("tppc")
    assert pa_params.network_name == "peercoin-testnet"

    # Try to find a network we don't know about.

# Path: pypeerassets/exceptions.py
# class UnsupportedNetwork(Exception):
#     '''This network is not suppored by pypeerassets.'''
# 
# Path: pypeerassets/pa_constants.py
# def param_query(name: str) -> PAParams:
#     '''Find the PAParams for a network by its long or short name. Raises
#     UnsupportedNetwork if no PAParams is found.
#     '''
# 
#     for pa_params in params:
#         if name in (pa_params.network_name, pa_params.network_shortname,):
#             return pa_params
# 
#     raise UnsupportedNetwork


# Path: test/test_pa_constants.py
import pytest
from pypeerassets.exceptions import UnsupportedNetwork
from pypeerassets.pa_constants import param_query




def test_param_query():
    "Check that we can find PAParams for networks by name."

    # Use a network's long name
    pa_params = param_query("peercoin")
    assert pa_params.network_shortname == "ppc"

    # Use a network's short name
    pa_params = param_query("tppc")
    assert pa_params.network_name == "peercoin-testnet"

    # Try to find a network we don't know about.

    with pytest.raises(UnsupportedNetwork):