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()
    remove.web = WebDummy()  # override the web variable in remove.py

    test_provider = "PROV"
    expected_providers_contents = ['What:\n', 'Test:']  # what we expect to see in providers.txt after we call GET
    # create the file
    with open(PROVIDERS_FILE_PATH, 'w') as f:
        f.writelines([
            "What:",
            "\n",
            test_provider + ":",
            "\n",
            "Test:"
        ])

    assert remove_provider.GET(test_provider) == "removed " + test_provider

    # read the file and see if it has removed the line with the test_provider
    with open(PROVIDERS_FILE_PATH, 'r') as f:
        provider_contents = f.readlines()

    delete_file(PROVIDERS_FILE_PATH)  # delete the file

    assert provider_contents == expected_providers_contents