# Path: vcontrol/rest/providers/remove.py
# class RemoveProviderR:
#     def GET(self, provider):


from os import remove as delete_file
from web import threadeddict
from vcontrol.rest.providers import remove
""" Test for the remove.py module in the vcontrol/rest/providers directory """


PROVIDERS_FILE_PATH = "../vcontrol/rest/providers/providers.txt"


class ContextDummy():
    env = threadeddict()
    env['HTTP_HOST'] = 'localhost:8080'


class WebDummy():
    # dummy class to emulate the web.ctx.env call in remove.py
    ctx = ContextDummy()


def test_successful_provider_removal():
    """ Here we give the module a text file with PROVIDER: written in it,
        it should remove that line in the file """

# Path: vcontrol/rest/providers/remove.py
# class RemoveProviderR:
#     def GET(self, provider):


# Path: tests/test_rest_providers_remove.py
from os import remove as delete_file
from web import threadeddict
from vcontrol.rest.providers import remove

""" Test for the remove.py module in the vcontrol/rest/providers directory """


PROVIDERS_FILE_PATH = "../vcontrol/rest/providers/providers.txt"


class ContextDummy():
    env = threadeddict()
    env['HTTP_HOST'] = 'localhost:8080'


class WebDummy():
    # dummy class to emulate the web.ctx.env call in remove.py
    ctx = ContextDummy()


def test_successful_provider_removal():
    """ Here we give the module a text file with PROVIDER: written in it,
        it should remove that line in the file """

    remove_provider = remove.RemoveProviderR()