# Path: bitcoinlib/main.py
# def script_type_default(witness_type=None, multisig=False, locking_script=False):
# def get_encoding_from_witness(witness_type=None):
# def deprecated(func):
#     def new_func(*args, **kwargs):
# 
# Path: bitcoinlib/db.py
# def compile_largebinary_mysql(type_, compiler, **kwargs):
#     def __init__(self, db_uri=None, password=None):
#     def drop_db(self, yes_i_am_sure=False):
#     def _import_config_data(ses):
# def add_column(engine, table_name, column):
#     def __repr__(self):
#     def __repr__(self):
#     def __repr__(self):
#     def __repr__(self):
# def db_update_version_id(db, version):
# def db_update(db, version_db, code_version=BITCOINLIB_VERSION):
# class Db:
# class DbConfig(Base):
# class DbWallet(Base):
# class DbKeyMultisigChildren(Base):
# class DbKey(Base):
# class DbNetwork(Base):
# class DbTransaction(Base):
# class DbTransactionInput(Base):
# class DbTransactionOutput(Base):
# 
# Path: bitcoinlib/encoding.py
# def normalize_string(string):
#     """
#     Normalize a string to the default NFKD unicode format
#     See https://en.wikipedia.org/wiki/Unicode_equivalence#Normalization
# 
#     :param string: string value
#     :type string: bytes, str
# 
#     :return: string
#     """
#     if isinstance(string, bytes):
#         utxt = string.decode('utf8')
#     elif isinstance(string, TYPE_TEXT):
#         utxt = string
#     else:
#         raise TypeError("String value expected")
# 
#     return unicodedata.normalize('NFKD', utxt)


import os
import sys
import unittest
    import mysql.connector
    import psycopg2
from subprocess import Popen, PIPE
    from parameterized import parameterized_class
    from psycopg2 import sql
    from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from bitcoinlib.main import UNITTESTS_FULL_DATABASE_TEST
from bitcoinlib.db import BCL_DATABASE_DIR
from bitcoinlib.encoding import normalize_string
                         (self.python_executable, self.clw_executable, self.DATABASE_URI)
        output_wlt_create = "14guS7uQpEbgf1e8TDo1zTEURJW3NGPc9E"
        output_wlt_delete = "Wallet test has been removed"

        process = Popen(cmd_wlt_create, stdin=PIPE, stdout=PIPE, shell=True)
        poutput = process.communicate(input=b'y')
        self.assertIn(output_wlt_create, normalize_string(poutput[0]))
        process = Popen(cmd_wlt_delete, stdin=PIPE, stdout=PIPE, shell=True)
        poutput = process.communicate(input=b'test')
        self.assertIn(output_wlt_delete, normalize_string(poutput[0]))

    def test_tools_clw_create_multisig_wallet(self):
        key_list = [
            'tprv8ZgxMBicQKsPd1Q44tfDiZC98iYouKRC2CzjT3HGt1yYw2zuX2awTotzGAZQEAU9bi2M5MCj8iedP9MREPjUgpDEBwBgGi2C8eK'
            '5zNYeiX8',
            'tprv8ZgxMBicQKsPeUbMS6kswJc11zgVEXUnUZuGo3bF6bBrAg1ieFfUdPc9UHqbD5HcXizThrcKike1c4z6xHrz6MWGwy8L6YKVbgJ'
            'MeQHdWDp'
        ]
        cmd_wlt_create = "%s %s testms -m 2 2 %s -r -n testnet -d %s" % \
                         (self.python_executable, self.clw_executable, ' '.join(key_list), self.DATABASE_URI)
        cmd_wlt_delete = "%s %s testms --wallet-remove -d %s" % \
                         (self.python_executable, self.clw_executable, self.DATABASE_URI)
        output_wlt_create = "2NBrLTapyFqU4Wo29xG4QeEt8kn38KVWRR"
        output_wlt_delete = "Wallet testms has been removed"

        process = Popen(cmd_wlt_create, stdin=PIPE, stdout=PIPE, shell=True)
        poutput = process.communicate(input=b'y')
        self.assertIn(output_wlt_create, normalize_string(poutput[0]))
        process = Popen(cmd_wlt_delete, stdin=PIPE, stdout=PIPE, shell=True)
        poutput = process.communicate(input=b'testms')

# Path: bitcoinlib/main.py
# def script_type_default(witness_type=None, multisig=False, locking_script=False):
# def get_encoding_from_witness(witness_type=None):
# def deprecated(func):
#     def new_func(*args, **kwargs):
# 
# Path: bitcoinlib/db.py
# def compile_largebinary_mysql(type_, compiler, **kwargs):
#     def __init__(self, db_uri=None, password=None):
#     def drop_db(self, yes_i_am_sure=False):
#     def _import_config_data(ses):
# def add_column(engine, table_name, column):
#     def __repr__(self):
#     def __repr__(self):
#     def __repr__(self):
#     def __repr__(self):
# def db_update_version_id(db, version):
# def db_update(db, version_db, code_version=BITCOINLIB_VERSION):
# class Db:
# class DbConfig(Base):
# class DbWallet(Base):
# class DbKeyMultisigChildren(Base):
# class DbKey(Base):
# class DbNetwork(Base):
# class DbTransaction(Base):
# class DbTransactionInput(Base):
# class DbTransactionOutput(Base):
# 
# Path: bitcoinlib/encoding.py
# def normalize_string(string):
#     """
#     Normalize a string to the default NFKD unicode format
#     See https://en.wikipedia.org/wiki/Unicode_equivalence#Normalization
# 
#     :param string: string value
#     :type string: bytes, str
# 
#     :return: string
#     """
#     if isinstance(string, bytes):
#         utxt = string.decode('utf8')
#     elif isinstance(string, TYPE_TEXT):
#         utxt = string
#     else:
#         raise TypeError("String value expected")
# 
#     return unicodedata.normalize('NFKD', utxt)


# Path: tests/test_tools.py
import os
import sys
import unittest
    import mysql.connector
    import psycopg2
from subprocess import Popen, PIPE
    from parameterized import parameterized_class
    from psycopg2 import sql
    from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from bitcoinlib.main import UNITTESTS_FULL_DATABASE_TEST
from bitcoinlib.db import BCL_DATABASE_DIR
from bitcoinlib.encoding import normalize_string

                         (self.python_executable, self.clw_executable, self.DATABASE_URI)
        output_wlt_create = "14guS7uQpEbgf1e8TDo1zTEURJW3NGPc9E"
        output_wlt_delete = "Wallet test has been removed"

        process = Popen(cmd_wlt_create, stdin=PIPE, stdout=PIPE, shell=True)
        poutput = process.communicate(input=b'y')
        self.assertIn(output_wlt_create, normalize_string(poutput[0]))
        process = Popen(cmd_wlt_delete, stdin=PIPE, stdout=PIPE, shell=True)
        poutput = process.communicate(input=b'test')
        self.assertIn(output_wlt_delete, normalize_string(poutput[0]))

    def test_tools_clw_create_multisig_wallet(self):
        key_list = [
            'tprv8ZgxMBicQKsPd1Q44tfDiZC98iYouKRC2CzjT3HGt1yYw2zuX2awTotzGAZQEAU9bi2M5MCj8iedP9MREPjUgpDEBwBgGi2C8eK'
            '5zNYeiX8',
            'tprv8ZgxMBicQKsPeUbMS6kswJc11zgVEXUnUZuGo3bF6bBrAg1ieFfUdPc9UHqbD5HcXizThrcKike1c4z6xHrz6MWGwy8L6YKVbgJ'
            'MeQHdWDp'
        ]
        cmd_wlt_create = "%s %s testms -m 2 2 %s -r -n testnet -d %s" % \
                         (self.python_executable, self.clw_executable, ' '.join(key_list), self.DATABASE_URI)
        cmd_wlt_delete = "%s %s testms --wallet-remove -d %s" % \
                         (self.python_executable, self.clw_executable, self.DATABASE_URI)
        output_wlt_create = "2NBrLTapyFqU4Wo29xG4QeEt8kn38KVWRR"
        output_wlt_delete = "Wallet testms has been removed"

        process = Popen(cmd_wlt_create, stdin=PIPE, stdout=PIPE, shell=True)
        poutput = process.communicate(input=b'y')
        self.assertIn(output_wlt_create, normalize_string(poutput[0]))
        process = Popen(cmd_wlt_delete, stdin=PIPE, stdout=PIPE, shell=True)
        poutput = process.communicate(input=b'testms')

        self.assertIn(output_wlt_delete, normalize_string(poutput[0]))