# Path: jmclient/jmclient/configure.py
# def load_test_config(**kwargs):
#     if "config_path" not in kwargs:
#         load_program_config(config_path=".", **kwargs)
#     else:
#         load_program_config(**kwargs)
# 
# def jm_single():
#     return global_singleton


import pytest
from jmclient import load_test_config, jm_single
from jmclient.configure import get_blockchain_interface_instance
    from jmclient.configure import AttributeDict
'''test configure module.'''



def test_attribute_dict():
    ad = AttributeDict(foo=1, bar=2, baz={"x":3, "y":4})
    assert ad.foo == 1
    assert ad.bar == 2
    assert ad.baz.x == 3
    assert ad["foo"] == 1


def test_load_config(tmpdir):
    load_test_config(bs="regtest")
    jm_single().config_location = "joinmarket.cfg"
    with pytest.raises(SystemExit):
        load_test_config(config_path=str(tmpdir), bs="regtest")
    jm_single().config_location = "joinmarket.cfg"
    load_test_config()


def test_blockchain_sources():

# Path: jmclient/jmclient/configure.py
# def load_test_config(**kwargs):
#     if "config_path" not in kwargs:
#         load_program_config(config_path=".", **kwargs)
#     else:
#         load_program_config(**kwargs)
# 
# def jm_single():
#     return global_singleton


# Path: jmclient/test/test_configure.py
import pytest
from jmclient import load_test_config, jm_single
from jmclient.configure import get_blockchain_interface_instance
    from jmclient.configure import AttributeDict

'''test configure module.'''



def test_attribute_dict():
    ad = AttributeDict(foo=1, bar=2, baz={"x":3, "y":4})
    assert ad.foo == 1
    assert ad.bar == 2
    assert ad.baz.x == 3
    assert ad["foo"] == 1


def test_load_config(tmpdir):
    load_test_config(bs="regtest")
    jm_single().config_location = "joinmarket.cfg"
    with pytest.raises(SystemExit):
        load_test_config(config_path=str(tmpdir), bs="regtest")
    jm_single().config_location = "joinmarket.cfg"
    load_test_config()


def test_blockchain_sources():

    load_test_config()