# Path: lcopt/data_store.py
# class LcoptStorage():
#     def __init__(self):
#     def load_config(self):
#     def refresh(self):
#     def write_default_config(self):
#     def write_config(self, config):
#     def models(self):
#     def search_indices(self):
#     def project_type(self):
#     def single_project_name(self):
#     def ecoinvent_version(self):
#     def ecoinvent_system_model(self):
#     def save_option(self):
# 
# Path: lcopt/constants.py
# DEFAULT_BIOSPHERE_PROJECT = "LCOPT_Setup_biosphere"
# 
# Path: lcopt/utils.py
# def bw2_project_exists(project_name):
#     return project_name in bw2.projects


import pytest
import os
import brightway2 as bw2
import yaml
from lcopt.data_store import storage
from copy import deepcopy
from lcopt.constants import DEFAULT_BIOSPHERE_PROJECT
from lcopt.utils import bw2_project_exists
    storage.config['model_storage']['project'] = 'unique'
    storage.config['model_storage']['location'] = 'currdir'



    if FULL_SETUP:
        bw2.projects.purge_deleted_directories()
        if TEST_MODEL_NAME in bw2.projects:
            bw2.projects.delete_project(name=TEST_MODEL_NAME, delete_dir=True)

        if bw2_project_exists(DEFAULT_BIOSPHERE_PROJECT):
            bw2.projects.set_current(DEFAULT_BIOSPHERE_PROJECT)
            bw2.projects.copy_project(TEST_MODEL_NAME, switch=True)
        else:
            bw2.projects.set_current(TEST_MODEL_NAME)
            bw2.bw2setup()
        

        script_path = os.path.dirname(os.path.realpath(__file__))
        ecospold_folder = os.path.join("tests", "assets", "datasets")
        ecospold_path = os.path.join(script_path, ecospold_folder)
        print(ecospold_path)

        ei = bw2.SingleOutputEcospold2Importer(ecospold_path, "Ecoinvent3_3_cutoff")
        ei.apply_strategies()
        ei.statistics()
        ei.write_database()

        bw2.projects.set_current('default')
    

# Path: lcopt/data_store.py
# class LcoptStorage():
#     def __init__(self):
#     def load_config(self):
#     def refresh(self):
#     def write_default_config(self):
#     def write_config(self, config):
#     def models(self):
#     def search_indices(self):
#     def project_type(self):
#     def single_project_name(self):
#     def ecoinvent_version(self):
#     def ecoinvent_system_model(self):
#     def save_option(self):
# 
# Path: lcopt/constants.py
# DEFAULT_BIOSPHERE_PROJECT = "LCOPT_Setup_biosphere"
# 
# Path: lcopt/utils.py
# def bw2_project_exists(project_name):
#     return project_name in bw2.projects


# Path: conftest.py
import pytest
import os
import brightway2 as bw2
import yaml
from lcopt.data_store import storage
from copy import deepcopy
from lcopt.constants import DEFAULT_BIOSPHERE_PROJECT
from lcopt.utils import bw2_project_exists

    storage.config['model_storage']['project'] = 'unique'
    storage.config['model_storage']['location'] = 'currdir'



    if FULL_SETUP:
        bw2.projects.purge_deleted_directories()
        if TEST_MODEL_NAME in bw2.projects:
            bw2.projects.delete_project(name=TEST_MODEL_NAME, delete_dir=True)

        if bw2_project_exists(DEFAULT_BIOSPHERE_PROJECT):
            bw2.projects.set_current(DEFAULT_BIOSPHERE_PROJECT)
            bw2.projects.copy_project(TEST_MODEL_NAME, switch=True)
        else:
            bw2.projects.set_current(TEST_MODEL_NAME)
            bw2.bw2setup()
        

        script_path = os.path.dirname(os.path.realpath(__file__))
        ecospold_folder = os.path.join("tests", "assets", "datasets")
        ecospold_path = os.path.join(script_path, ecospold_folder)
        print(ecospold_path)

        ei = bw2.SingleOutputEcospold2Importer(ecospold_path, "Ecoinvent3_3_cutoff")
        ei.apply_strategies()
        ei.statistics()
        ei.write_database()

        bw2.projects.set_current('default')
    

    def teardown_fixtures():