<commit_before>import os
import shutil
import sqlite3
import json

import gevent
from zmq.utils import jsonapi

from volttrontesting.utils.platformwrapper import PlatformWrapper
from volttron.platform.vip.agent import Agent
from volttron.platform.agent.base_historian import BaseHistorian


class Historian(BaseHistorian):
    def publish_to_historian(self,_):
        pass
    def query_topic_list(self):
        pass
    def query_historian(self):
        pass


def prep_config(volttron_home):
    src_driver = os.getcwd() + '/services/core/MasterDriverAgent/master_driver/test_fakedriver.config'
    new_driver = volttron_home + '/test_fakedriver.config'
    shutil.copy(src_driver, new_driver)

    with open(new_driver, 'r+') as f:
        config = json.load(f)
        config['registry_config'] = os.getcwd() + '/services/core/MasterDriverAgent/master_driver/fake.csv'
        f.seek(0)
        f.truncate()
        json.dump(config, f)

    master_config = {
        "agentid": "master_driver",
        "driver_config_list": [new_driver]
    }

    return master_config


foundtopic = False
def listener(peer, sender, bus, topic, headers, message):
    global foundtopic
    foundtopic = True


def test_base_historian(volttron_instance1):
    global foundtopic<commit_msg>Remove test that uses hardcoded paths<commit_after>import os
import shutil
import sqlite3
import json

import gevent
from zmq.utils import jsonapi

from volttrontesting.utils.platformwrapper import PlatformWrapper
from volttron.platform.vip.agent import Agent
from volttron.platform.agent.base_historian import BaseHistorian


class Historian(BaseHistorian):
    def publish_to_historian(self,_):
        pass
    def query_topic_list(self):
        pass
    def query_historian(self):
        pass


def prep_config(volttron_home):
    src_driver = os.getcwd() + '/services/core/MasterDriverAgent/master_driver/test_fakedriver.config'
    new_driver = volttron_home + '/test_fakedriver.config'
    shutil.copy(src_driver, new_driver)

    with open(new_driver, 'r+') as f:
        config = json.load(f)
        config['registry_config'] = os.getcwd() + '/services/core/MasterDriverAgent/master_driver/fake.csv'
        f.seek(0)
        f.truncate()
        json.dump(config, f)

    master_config = {
        "agentid": "master_driver",
        "driver_config_list": [new_driver]
    }

    return master_config


foundtopic = False
def listener(peer, sender, bus, topic, headers, message):
    global foundtopic
    foundtopic = True


@pytest.mark.xfail(reason="This won't work on all machines because of hardcoded paths.")
def test_base_historian(volttron_instance1):
    global foundtopic
{'fraction_non_alphanumeric': 0.09046728971962617, 'fraction_numerical': 0.0022429906542056075, 'mean_word_length': 3.770053475935829, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, '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': '6266863', 'n_tokens_mistral': 863, 'n_tokens_neox': 818, 'n_words': 184}