# Path: katprep/exceptions.py
# class EmptySetException(Exception):
#     """
#     Dummy class for empty result sets
# 
#     .. class:: EmptySetException
#     """
# 
# class InvalidCredentialsException(Exception):
#     """
#     Dummy class for invalid credentials
# 
#     .. class:: InvalidCredentialsException
#     """
# 
# class SessionException(Exception):
#     """
#     Dummy class for session errors
# 
#     .. class:: SessionException
#     """
# 
# Path: tests/utilities.py
# def load_config(config_file):
#     if not os.path.isfile(config_file):
#         pytest.skip("Please create configuration file %s!" % config_file)
# 
#     try:
#         with open(config_file, "r") as json_file:
#             return json.load(json_file)
#     except IOError as err:
#         pytest.skip("Unable to read configuration file: '%s'", err)


import logging
import pytest
from katprep.exceptions import (EmptySetException,
InvalidCredentialsException, SessionException)
from .utilities import load_config
    """
    with pytest.raises(SessionException):
        virtClient.remove_snapshot(nonexisting_vm, snapshot_name)


def test_has_snapshot_fail(virtClient, nonexisting_vm, snapshot_name):
    """
    Ensure that checking non-existing VMs for snapshots is not possible
    """
    with pytest.raises(EmptySetException):
        virtClient.has_snapshot(nonexisting_vm, snapshot_name)


def test_revert_snapshot_fail(virtClient, nonexisting_vm, snapshot_name):
    """
    Ensure that reverting non-existing snapshots is not possible
    """
    with pytest.raises(SessionException):
        virtClient.revert_snapshot(nonexisting_vm, snapshot_name)


def test_snapshot_handling(virtClient, config, snapshot_name):
    host = config["valid_objects"]["vm"]
    virtClient.create_snapshot(host, snapshot_name, snapshot_name)

    try:
        virtClient.revert_snapshot(host, snapshot_name)

        try:
            assert virtClient.has_snapshot(host, snapshot_name)

# Path: katprep/exceptions.py
# class EmptySetException(Exception):
#     """
#     Dummy class for empty result sets
# 
#     .. class:: EmptySetException
#     """
# 
# class InvalidCredentialsException(Exception):
#     """
#     Dummy class for invalid credentials
# 
#     .. class:: InvalidCredentialsException
#     """
# 
# class SessionException(Exception):
#     """
#     Dummy class for session errors
# 
#     .. class:: SessionException
#     """
# 
# Path: tests/utilities.py
# def load_config(config_file):
#     if not os.path.isfile(config_file):
#         pytest.skip("Please create configuration file %s!" % config_file)
# 
#     try:
#         with open(config_file, "r") as json_file:
#             return json.load(json_file)
#     except IOError as err:
#         pytest.skip("Unable to read configuration file: '%s'", err)


# Path: tests/test_LibvirtClient.py
import logging
import pytest
from katprep.exceptions import (EmptySetException,
InvalidCredentialsException, SessionException)
from .utilities import load_config

    """
    with pytest.raises(SessionException):
        virtClient.remove_snapshot(nonexisting_vm, snapshot_name)


def test_has_snapshot_fail(virtClient, nonexisting_vm, snapshot_name):
    """
    Ensure that checking non-existing VMs for snapshots is not possible
    """
    with pytest.raises(EmptySetException):
        virtClient.has_snapshot(nonexisting_vm, snapshot_name)


def test_revert_snapshot_fail(virtClient, nonexisting_vm, snapshot_name):
    """
    Ensure that reverting non-existing snapshots is not possible
    """
    with pytest.raises(SessionException):
        virtClient.revert_snapshot(nonexisting_vm, snapshot_name)


def test_snapshot_handling(virtClient, config, snapshot_name):
    host = config["valid_objects"]["vm"]
    virtClient.create_snapshot(host, snapshot_name, snapshot_name)

    try:
        virtClient.revert_snapshot(host, snapshot_name)

        try:
            assert virtClient.has_snapshot(host, snapshot_name)

        except EmptySetException as err: