<commit_before>import unittest
import mysql.connector
from mysql_wrapper import MySQLWrapper as dbwrap
from mocks.mock_procserv_utils import MockProcServWrapper

TEST_DB = 'test_iocdb'
HIGH_PV_NAMES = list()
MEDIUM_PV_NAMES = list()
BL_PVS = ["PARS:BL:FOEMIRROR", "PARS:BL:A1", "PARS:BL:CHOPEN:ANG"]
SAMPLE_PVS = ["PARS:SAMPLE:AOI", "PARS:SAMPLE:GEOMETRY", "PARS:SAMPLE:WIDTH"]


def generate_fake_db(iocdb):
    import sys
    import shutil
    import os
    import fileinput
    #create the schema file
    schemapath = os.path.join(os.environ['EPICS_KIT_ROOT'],'iocstartup\\iocdb_mysql_schema.txt')
    testpath = os.path.join(os.environ['EPICS_KIT_ROOT'],'iocstartup\\test_iocdb_mysql_schema.txt')
    schemafile = open(schemapath, 'r')
    testfile = open(testpath, 'w')
    for line in schemafile:
        if not line.isspace():
            if line[:3] == "-- " or line[0] == "#":
                pass
            else:
                testfile.write(line.replace('iocdb',iocdb))
    schemafile.close()
    testfile.close()
    #Note that the account below is the test account, and is only available on localhost
    cnx = mysql.connector.connect(user="isis_test", password="<PASSWORD>", host="localhost")
    cursor = cnx.cursor()
    testfile = open(testpath, 'r')
    sql = testfile.read()
    for result in cursor.execute(sql,multi = True):
        pass
    cnx.commit()
    cursor.close()
    cnx.disconnect()
    #Move the connection to the appropriate database for ease of table creation<commit_msg>stroy #572 - updating the username/password for the correct test account!<commit_after>import unittest
import mysql.connector
from mysql_wrapper import MySQLWrapper as dbwrap
from mocks.mock_procserv_utils import MockProcServWrapper

TEST_DB = 'test_iocdb'
HIGH_PV_NAMES = list()
MEDIUM_PV_NAMES = list()
BL_PVS = ["PARS:BL:FOEMIRROR", "PARS:BL:A1", "PARS:BL:CHOPEN:ANG"]
SAMPLE_PVS = ["PARS:SAMPLE:AOI", "PARS:SAMPLE:GEOMETRY", "PARS:SAMPLE:WIDTH"]


def generate_fake_db(iocdb):
    import sys
    import shutil
    import os
    import fileinput
    #create the schema file
    schemapath = os.path.join(os.environ['EPICS_KIT_ROOT'],'iocstartup\\iocdb_mysql_schema.txt')
    testpath = os.path.join(os.environ['EPICS_KIT_ROOT'],'iocstartup\\test_iocdb_mysql_schema.txt')
    schemafile = open(schemapath, 'r')
    testfile = open(testpath, 'w')
    for line in schemafile:
        if not line.isspace():
            if line[:3] == "-- " or line[0] == "#":
                pass
            else:
                testfile.write(line.replace('iocdb',iocdb))
    schemafile.close()
    testfile.close()
    #Note that the account below is the test account, and is only available on localhost
    cnx = mysql.connector.connect(user="isis_test", password="<PASSWORD>", host="localhost")
    cursor = cnx.cursor()
    testfile = open(testpath, 'r')
    sql = testfile.read()
    for result in cursor.execute(sql,multi = True):
        pass
    cnx.commit()
    cursor.close()
    cnx.disconnect()
    #Move the connection to the appropriate database for ease of table creation
{'fraction_non_alphanumeric': 0.12127107652399481, 'fraction_numerical': 0.0029182879377431907, 'mean_word_length': 3.6530920060331824, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5146370', 'n_tokens_mistral': 1030, 'n_tokens_neox': 1035, 'n_words': 238}