# Path: core/commands.py
# @command(autocomplete=lambda: list_campaigns(),
#          examples=["my-simulation-campaign"],
#          expand=('exp_file', {'into': EXPERIMENT_FOLDER, 'ext': 'json'}),
#          exists=('exp_file', {'on_boolean': 'ask', 'confirm': "Are you sure ? (yes|no) [default: no] "}),
#          start_msg=("REMOVING EXPERIMENT CAMPAIGN AT '{}'", 'exp_file'))
# def drop(exp_file, ask=True, **kwargs):
#     """
#     Remove a campaign of experiments.
# 
#     :param exp_file: experiments JSON filename or basename (absolute or relative path ; if no path provided,
#                      the JSON file is searched in the experiments folder)
#     :param ask: ask confirmation
#     :param kwargs: simulation keyword arguments (see the documentation for more information)
#     """
#     remove_files(EXPERIMENT_FOLDER, exp_file)
# 
# @command(autocomplete=lambda: list_campaigns(),
#          examples=["my-simulation-campaign"],
#          expand=('exp_file', {'into': EXPERIMENT_FOLDER, 'ext': 'json'}),
#          exists=('exp_file', {'loglvl': 'warning', 'msg': (" > Experiment campaign '{}' already exists !", 'exp_file'),
#                               'on_boolean': 'ask', 'confirm': "Overwrite ? (yes|no) [default: no] "}),
#          start_msg=("CREATING NEW EXPERIMENT CAMPAIGN AT '{}'", 'exp_file'))
# def prepare(exp_file, ask=True, **kwargs):
#     """
#     Create a campaign of experiments from a template.
# 
#     :param exp_file: experiments JSON filename or basename (absolute or relative path ; if no path provided,
#                      the JSON file is searched in the experiments folder)
#     :param ask: ask confirmation
#     :param kwargs: simulation keyword arguments (see the documentation for more information)
#     """
#     render_campaign(exp_file)
# 
# Path: core/conf/constants.py
# EXPERIMENT_FOLDER = abspath(expanduser(confparser.get("RPL Attacks Framework Configuration", "experiments_folder")))


import sh
import unittest
from jsmin import jsmin
from json import loads
from os.path import exists, expanduser, join
from core.commands import drop, prepare
from core.conf.constants import EXPERIMENT_FOLDER
#!/usr/bin/env python
# -*- coding: utf-8 -*-



JSON = 'test-campaign.json'


class ExperimentTestCase(unittest.TestCase):
    path = expanduser(join(EXPERIMENT_FOLDER, JSON))
    backup = path + '.backup'



# Path: core/commands.py
# @command(autocomplete=lambda: list_campaigns(),
#          examples=["my-simulation-campaign"],
#          expand=('exp_file', {'into': EXPERIMENT_FOLDER, 'ext': 'json'}),
#          exists=('exp_file', {'on_boolean': 'ask', 'confirm': "Are you sure ? (yes|no) [default: no] "}),
#          start_msg=("REMOVING EXPERIMENT CAMPAIGN AT '{}'", 'exp_file'))
# def drop(exp_file, ask=True, **kwargs):
#     """
#     Remove a campaign of experiments.
# 
#     :param exp_file: experiments JSON filename or basename (absolute or relative path ; if no path provided,
#                      the JSON file is searched in the experiments folder)
#     :param ask: ask confirmation
#     :param kwargs: simulation keyword arguments (see the documentation for more information)
#     """
#     remove_files(EXPERIMENT_FOLDER, exp_file)
# 
# @command(autocomplete=lambda: list_campaigns(),
#          examples=["my-simulation-campaign"],
#          expand=('exp_file', {'into': EXPERIMENT_FOLDER, 'ext': 'json'}),
#          exists=('exp_file', {'loglvl': 'warning', 'msg': (" > Experiment campaign '{}' already exists !", 'exp_file'),
#                               'on_boolean': 'ask', 'confirm': "Overwrite ? (yes|no) [default: no] "}),
#          start_msg=("CREATING NEW EXPERIMENT CAMPAIGN AT '{}'", 'exp_file'))
# def prepare(exp_file, ask=True, **kwargs):
#     """
#     Create a campaign of experiments from a template.
# 
#     :param exp_file: experiments JSON filename or basename (absolute or relative path ; if no path provided,
#                      the JSON file is searched in the experiments folder)
#     :param ask: ask confirmation
#     :param kwargs: simulation keyword arguments (see the documentation for more information)
#     """
#     render_campaign(exp_file)
# 
# Path: core/conf/constants.py
# EXPERIMENT_FOLDER = abspath(expanduser(confparser.get("RPL Attacks Framework Configuration", "experiments_folder")))


# Path: tests/campaign.py
import sh
import unittest
from jsmin import jsmin
from json import loads
from os.path import exists, expanduser, join
from core.commands import drop, prepare
from core.conf.constants import EXPERIMENT_FOLDER

#!/usr/bin/env python
# -*- coding: utf-8 -*-



JSON = 'test-campaign.json'


class ExperimentTestCase(unittest.TestCase):
    path = expanduser(join(EXPERIMENT_FOLDER, JSON))
    backup = path + '.backup'



class Test6Prepare(ExperimentTestCase):