# Path: pypeerassets/exceptions.py
# class UnsupportedNetwork(Exception):
#     '''This network is not suppored by pypeerassets.'''
# 
# Path: pypeerassets/networks.py
# def net_query(name: str) -> Constants:
#     '''Find the NetworkParams for a network by its long or short name. Raises
#     UnsupportedNetwork if no NetworkParams is found.
#     '''
# 
#     for net_params in networks:
#         if name in (net_params.name, net_params.shortname,):
#             return net_params
# 
#     raise UnsupportedNetwork


import pytest
from pypeerassets.exceptions import UnsupportedNetwork
from pypeerassets.networks import net_query



def test_net_query():
    "Check that we can find NetworkParams for networks by name."

    # Use a network's long name
    net_params = net_query("peercoin")
    assert net_params.shortname == "ppc"

    # Use a network's short name
    net_params = net_query("tppc")
    assert net_params.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/networks.py
# def net_query(name: str) -> Constants:
#     '''Find the NetworkParams for a network by its long or short name. Raises
#     UnsupportedNetwork if no NetworkParams is found.
#     '''
# 
#     for net_params in networks:
#         if name in (net_params.name, net_params.shortname,):
#             return net_params
# 
#     raise UnsupportedNetwork


# Path: test/test_networks.py
import pytest
from pypeerassets.exceptions import UnsupportedNetwork
from pypeerassets.networks import net_query




def test_net_query():
    "Check that we can find NetworkParams for networks by name."

    # Use a network's long name
    net_params = net_query("peercoin")
    assert net_params.shortname == "ppc"

    # Use a network's short name
    net_params = net_query("tppc")
    assert net_params.name == "peercoin-testnet"

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

    with pytest.raises(UnsupportedNetwork):