Repository: cekit/cekit

Issue:
Update documentation for artifacts definition
Make it clear what keys are required and what are optional.

Discussion:

Patch:
diff --git a/cekit/cli.py b/cekit/cli.py
index 6de2472..5fd8f2f 100644
--- a/cekit/cli.py
+++ b/cekit/cli.py
@@ -258,7 +258,7 @@ def run_command(ctx, clazz):
 
 def run_test(ctx, tester):
     if tester == 'behave':
-        from cekit.test.behave import BehaveTester as tester_impl
+        from cekit.test.behave_tester import BehaveTester as tester_impl
         LOGGER.info("Using Behave tester to test the image")
     else:
         raise CekitError("Tester engine {} is not supported".format(tester))
@@ -287,7 +287,7 @@ def run_build(ctx, builder):
     run_command(ctx, builder_impl)
 
 
-class Cekit(object):  # pylint: disable=useless-object-inheritance
+class Cekit(object):
     """ Main application """
 
     def __init__(self, params):
diff --git a/docs/conf.py b/docs/conf.py
index 84e7e0c..d960cef 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -19,6 +19,7 @@ def setup(app):
 extensions = ['sphinx.ext.autosectionlabel', 'sphinx.ext.todo']
 # http://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html#confval-autosectionlabel_prefix_document
 autosectionlabel_prefix_document = True
+autosectionlabel_maxdepth = 4
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
diff --git a/docs/descriptor/artifacts.rst b/docs/descriptor/artifacts.rst
index 4f84646..6b3ac87 100644
--- a/docs/descriptor/artifacts.rst
+++ b/docs/descriptor/artifacts.rst
@@ -2,24 +2,95 @@ Artifacts
 ---------
 
 It's common for images to require external artifacts like jar files, installers, etc.
-In most cases you will want to add files into the image and use them during  image build process.
+In most cases you will want to add some files into the image and use them during image build process.
 
-Artifacts section is meant exactly for this. *CEKit will automatically
-fetch any artifacts* specified in this section and check their consistency by computing checksum of
-the downloaded file and comparing it with the desired value. Currently supported algorithms are: md5, sha1 and sha256. If no algorithm is provided, artifact will  be fetched **every** time.
+Artifacts section is meant exactly for this. CEKit will *automatically*
+fetch any artifacts specified in this section.
 
-All artifacts are automatically cached during an image build. To learn more about cache please take a look at :ref:`artifacts_caching`
+If for some reason automatic fetching of artifacts is not an option for you,
+yoy should define artifacts as plain artifacts and use the ``cekit-cache``
+command to add the artifact to local cache, making it available for the build
+process automatically. See :doc:`/caching` chapter.
 
+Artifact features
+^^^^^^^^^^^^^^^^^^^^
+
+Checksums
+    All artifacts will be checked for consistency by computing checksum of
+    the downloaded file and comparing it with the desired value. Currently supported algorithms
+    are: ``md5``, ``sha1`` and ``sha256``.
+
+    You can define multiple checksums for a single artifact. All specfied checksums will
+    be validated.
+
+    If no algorithm is provided, artifacts will be fetched **every time**.
+
+    This can be useful when building images with snapshot content. In this case you are not
+    concerned about the consistency but rather focusing on rapid
+    development. We advice that you define checksum when your content becomes stable.
+
+Caching
+    All artifacts are automatically cached during an image build. To learn more about caching please take a look at :doc:`/caching` chapter.
+
+
+Common artifact keys
+^^^^^^^^^^^^^^^^^^^^
+
+``name``
+    Used to define unique identifier of the artifact.
+
+    The ``name`` key is very important. It's role is to provide a unique identifier for the artifact.
+    If it's not provided, it will be computed from the resource definition, but we **strongly suggest**
+    to provide the ``name`` keys always.
+
+    Value of this key does not need to be a filename, because it's just an identifier used
+    to refer the artifact. Using meaningful and unique identifiers is important in case when
+    you want to use :doc:`/overrides`. It will make it much easier to refer the artifact
+    and thus override it.
+
+``target``
+    The output name for fetched resources will match the ``target`` attribute. If it is not defined
+    then base name of the ``name`` attribute will be used. If it's not provided either then base name
+    of the path/URL will be used.
+
+    Below you can find a few examples.
+
+        .. code-block:: yaml
 
-The output name for downloaded resources will match the ``target`` attribute, which defaults to
-the base name of the file/URL. 
+            artifacts:
+                - name: jboss-eap-distribution
+                  path: jboss-eap-6.4.0.zip
+                  target: jboss-eap.zip
 
+        Target file name: ``jboss-eap.zip``.
 
+        .. code-block:: yaml
 
-.. note:: 
+            artifacts:
+                - name: jboss-eap-distribution
+                  path: jboss-eap-6.4.0.zip
 
-   For artifacts that are not publicly available CEKit provides a way to
-   add a description detailing a location from which the artifact can be obtained.
+        Target file name: ``jboss-eap-distribution``.
+
+        .. code-block:: yaml
+
+            artifacts:
+                - path: jboss-eap-6.4.0.zip
+
+        Target file name: ``jboss-eap-6.4.0.zip``.
+
+``md5``, ``sha1``, ``sha256``
+    Checksum algorithms. These keys can be provided to make sure the fetched artifact
+    is valid.
+
+    See section above about checksums.
+
+``description``
+   Describes the artifact. This is an optional key that can be used to add more information
+   about the artifact.
+
+   Adding description to artifacts makes it much easier to understand what artifact
+   it is just by looking at the image/module descriptor.
 
    .. code-block:: yaml
 
@@ -30,17 +101,27 @@ the base name of the file/URL.
 
    If CEKit is not able to download an artifact and this artifact has a ``description`` defined -- the build
    will fail but a message with the description will be printed together with information on where to place
-   the manually downloaded artifact.
+   the manually downloaded artifact so that the build could be resumed.
 
+Artifact types
+^^^^^^^^^^^^^^^^^^^^
+
+CEKit supports following artifact types:
 
+* Plain artifacts
+* URL artifacts
+* Path artifacts
 
 Plain artifacts
-^^^^^^^^^^^^^^^^^^^^
+******************
+
+This is an abstract way of defining artifacts. The only required keys are ``name`` and checksum.
+This type of artifacts is used to define artifacts that are not available publicly and instead
+provided by some (internal) systems.
 
-This is the easiest way of defining an artifact. You are just specifying its name and **md5** checksum.
-This approach relies on :ref:`artifacts_caching` to provide the artifact in cache. This section should be used to show that a particular artifact is needed for the image but its not publicly available.
+This approach relies on :doc:`/caching` to provide the artifact.
 
-.. code:: yaml 
+.. code-block:: yaml 
 
     artifacts:
         - name: jolokia-1.3.6-bin.tar.gz
@@ -49,15 +130,18 @@ This approach relies on :ref:`artifacts_caching` to provide the artifact in cach
 
 .. note::
 
-   See :ref:`Red Hat Environment<redhat_env>` for a description how Plain Artifacts are affected by Red
-   Hat switch.
+   See :doc:`/redhat` for description how plain artifacts are used in the
+   Red Hat environment.
 
           
 URL artifacts
-^^^^^^^^^^^^^^^^^^
+******************
 
-This way of defining repository ask CEKit to download and artifact from a specified URL.
+This is the simplest way of defining artifacts. You need to provide the ``url`` key which is the URL from where the
+artifact should be fetched from.
 
+.. tip::
+    You should always specify checksums to make sure the downloaded artifact is correct.
 
 .. code-block:: yaml
 
@@ -66,14 +150,11 @@ This way of defining repository ask CEKit to download and artifact from a specif
           url: https://github.com/rhuss/jolokia/releases/download/v1.3.6/jolokia-1.3.6-bin.tar.gz
           md5: 75e5b5ba0b804cd9def9f20a70af649f
 
-
-
-
 Path artifacts
-^^^^^^^^^^^^^^^^^^^
+******************
 
-This way of defining artifact is mostly used in development overrides and enables you to inject
-an artifact from a local filesystem.
+This way of defining artifacts is mostly used in development :doc:`overrides</overrides>` and enables you to inject
+artifacts from a local filesystem.
 
 .. code-block:: yaml
 
@@ -84,11 +165,12 @@ an artifact from a local filesystem.
 
 .. note::
 
-   If you are using relative ``path`` to define an artifact, path is considered relative to an
-   image descriptor which introduced that artifact.
+    If you are using relative ``path`` to define an artifact, path is considered relative to an
+    image descriptor which introduced that artifact.
    
-   **Example**: If an artifact is defined inside */foo/bar/image.yaml* with a path: *baz/1.zip*
-   the artifact will be resolved as */foo/bar/baz/1.zip*
+    Example
+        If an artifact is defined inside ``/foo/bar/image.yaml`` with a path: ``baz/1.zip``
+        the artifact will be resolved as ``/foo/bar/baz/1.zip``
 
 
 
diff --git a/docs/descriptor/image.rst b/docs/descriptor/image.rst
index 91cfc48..64876c7 100644
--- a/docs/descriptor/image.rst
+++ b/docs/descriptor/image.rst
@@ -3,6 +3,7 @@ Image descriptor
 Image descriptor contains all information CEKit needs to build and test a container image.
 
 .. contents::
+    :backlinks: none
 
 .. include:: name.rst
 .. include:: version.rst
diff --git a/docs/installation/instructions.rst b/docs/installation/instructions.rst
index eb69a06..93748d1 100644
--- a/docs/installation/instructions.rst
+++ b/docs/installation/instructions.rst
@@ -3,48 +3,53 @@ Installation instructions
 
 .. contents::
 
-We provide RPM packages for Fedora, CentOS, RHEL distribution.
-CEKit installation on other platforms is still possible via ``pip``
+We provide RPM packages for Fedora, CentOS/RHEL distribution.
+CEKit installation on other platforms is still possible via ``pip``.
 
-On RHEL derivatives we strongly suggest installing CEKit using the YUM/DNF package
-manager. We provide a `COPR repository for CEKit <https://copr.fedorainfracloud.org/coprs/g/cekit/cekit/>`_
-which contains everything needed to install CEKit.
+RPM packages are distributed via regular repositories in case of Fedora
+and the EPEL repository for CentOS/RHEL.
 
 .. warning::
+    Currently packaged version is a snapshot release of the upcoming CEKit 3.0.
 
-   Make sure you read the :doc:`dependencies chapter</installation/dependencies>` of this documentation which contains important
+.. tip::
+    You can see latest submitted package updates `submitted in Bodhi <https://bodhi.fedoraproject.org/updates/?packages=cekit>`_.
+
+.. warning::
+
+   Make sure you read the :doc:`dependencies </installation/dependencies>` chapter which contains important
    information about how CEKit dependencies are handled!
 
 Fedora
 -------------------
 
-Supported versions: 27+.
+.. note::
+    Supported versions: 29+.
 
-For Fedora we provide a custom Copr repository.  To `enable the "cekit" repository <https://docs.pagure.org/copr.copr/how_to_enable_repo.html>`_ and install CEKit on your system, please run:
+CEKit is available from regular Fedora repositories.
 
 .. code-block:: bash
 
-    dnf install dnf-plugins-core
-    dnf copr enable @cekit/cekit
-    dnf install python3-cekit
+    dnf install cekit
 
 CentOS / RHEL
 -------------------
 
-Supported versions: 7.x
+.. note::
+    Supported versions: 7.x
 
-For RHEL / CentOS we provide custom Copr repository. To enable the repository and install
-CEKit on your system please run:
+CEKit is available from the `EPEL repository <https://fedoraproject.org/wiki/EPEL>`_.
 
 .. code-block:: bash
 
-    curl https://copr.fedorainfracloud.org/coprs/g/cekit/cekit/repo/epel-7/group_cekit-cekit-epel-7.repo -o /etc/yum.repos.d/cekit-epel-7.repo
-    yum install python2-cekit
+    yum install epel-release
+    yum install cekit
 
 Other systems
 -------------------
 
-We strongly advise to use `Virtualenv <https://virtualenv.pypa.io/en/stable/>`_ to install CEKit. Please consult your package manager for the correct package name.
+We strongly advise to use `Virtualenv <https://virtualenv.pypa.io/en/stable/>`_ to install CEKit.
+Please consult your package manager for the correct package name.
 
 To create custom Python virtual environment please run following commands on your system:
 
@@ -63,7 +68,8 @@ To create custom Python virtual environment please run following commands on you
 
 .. note::
 
-   Every time you want to use CEKit you must activate CEKit Python virtual environment by executing ``source ~/cekit/bin/activate``
+   Every time you want to use CEKit you must activate CEKit Python virtual environment by
+   executing ``source ~/cekit/bin/activate``
 
 If you don't want to (or cannot) use Virtualenv, the best idea is to install CEKit in the user's home with the
 ``--user`` prefix:
@@ -72,12 +78,6 @@ If you don't want to (or cannot) use Virtualenv, the best idea is to install CEK
 
     pip install -U cekit --user
 
-.. .. include:: dependencies.rst
-
-.. .. include:: upgrade.rst
-
-.. .. toctree::
-..     :titlesonly:
-    
-..     dependencies
-..     upgrade
\ No newline at end of file
+.. note::
+    In this case you may need to add ``~/.local/bin/`` directory to your ``$PATH`` environment variable to
+    be able to run the ``cekit`` command.
\ No newline at end of file
diff --git a/docs/installation/upgrade.rst b/docs/installation/upgrade.rst
index 6f1aa49..d78eff0 100644
--- a/docs/installation/upgrade.rst
+++ b/docs/installation/upgrade.rst
@@ -3,26 +3,49 @@ Upgrading
 
 .. note::
 
-    If you are running on Fedora / CentOS / RHEL you should be using RPM and our `COPR repository for CEKit <https://copr.fedorainfracloud.org/coprs/g/cekit/cekit/>`_. We assume, that you have this repository enabled on your system.
+    If you run on Fedora / CentOS / RHEL you should be using RPMs
+    from regular repositories. Please see :doc:`installation instructions </installation/instructions>`.
+
+Upgrade from CEKit 2.x
+-----------------------
+
+Previous CEKit releases were provided via the `COPR repository <https://copr.fedorainfracloud.org/coprs/g/cekit/cekit/>`_
+which is now **deprecated**. The COPR repository **won't be updated anymore** with new releases.
+
+Fedora packages are not compatible with packages that come from the
+`deprecated COPR repository <https://copr.fedorainfracloud.org/coprs/g/cekit/cekit/>`_,
+you need to uninstall any packages that came from it before upgrading.
+
+.. tip::
+    You can use ``dnf repolist`` to get the repository id (should be ``group_cekit-cekit`` by default)
+    which can be used for querying installed packages and removing them:
+
+    .. code-block:: bash
+
+        dnf list installed | grep @group_cekit-cekit | cut -f 1 -d ' ' | xargs sudo dnf remove {}\;
+
+Once all packages that came from the COPR repository you can follow the :doc:`installation instructions </installation/instructions>`.
 
 Fedora
 --------------------
 
 .. code-block:: bash
 
-    dnf update python3-cekit
+    dnf update cekit
 
 CentOS / RHEL
 --------------------
 
 .. code-block:: bash
 
-    yum update python2-cekit
+    yum update cekit
 
 
 Other systems
 -------------
 
+Use the ``pip -U`` switch to upgrade the installed module.
+
 .. code-block:: bash
 
     pip install -U cekit --user
diff --git a/docs/redhat.rst b/docs/redhat.rst
index 8ed2031..86f5807 100644
--- a/docs/redhat.rst
+++ b/docs/redhat.rst
@@ -43,14 +43,27 @@ injected into the image you are building and you can successfully build an image
 Artifacts
 ---------
 
-In Red Hat environment we are using Brew to build our packages and artifacts. CEKit provides an integration layer with Brew and enables to use artifact directly from Brew. To enable this set :ref:`redhat configuration option<redhat_config>` to True and define artifact **only** by specifying its ``md5`` checksum.
+In Red Hat environment we are using Brew to build our packages and artifacts.
+CEKit provides an integration layer with Brew and enables to use artifact
+directly from Brew. To enable this set :ref:`redhat configuration option<redhat_config>`
+to ``True`` (or use ``--redhat`` switch) and define plain artifacts which have ``md5`` checksum.
 
+.. warning::
+    Using different checksum thn ``md5`` will not work!
 
-*Example:* Following artifact will be fetched directly from brew for Docker build and uses `Brew/OSBS inegration <https://osbs.readthedocs.io/en/latest/users.html#fetch-artifacts-url-yaml>`_ for OSBS build.
+CEKit will fetch artifacts automatically from Brew, adding them to local cache.
 
-.. code:: yaml
+Depending on the selected builders, different preparations
+will be performed to make it ready for the build process:
 
-    artifacts:
-      - md5: d31c6b1525e6d2d24062ef26a9f639a8
-        name: jolokia-jvm-1.5.0.redhat-1-agent.jar
+* for Docker/Buildah/Podman builder it will be available directly,
+* for OSBS builder it uses the `Brew/OSBS integration <https://osbs.readthedocs.io/en/latest/users.html#fetch-artifacts-url-yaml>`_.
 
+Example
+    .. code-block:: yaml
+
+        artifacts:
+            - name: jolokia-jvm-1.5.0.redhat-1-agent.jar
+              md5: d31c6b1525e6d2d24062ef26a9f639a8
+
+    This is everything required to fetch the artifact.


Test patch:
diff --git a/cekit/test/runner.py b/cekit/test/behave_runner.py
similarity index 75%
rename from cekit/test/runner.py
rename to cekit/test/behave_runner.py
index e43c2db..3fc5ef6 100644
--- a/cekit/test/runner.py
+++ b/cekit/test/behave_runner.py
@@ -1,27 +1,34 @@
 import getpass
 import logging
 import os
-import subprocess
 
 from cekit.errors import CekitError
 from cekit.tools import Chdir
 
+try:
+    from behave.__main__ import main as behave_main
+except ImportError:
+    pass
+
 logger = logging.getLogger('cekit')
 
 
-class TestRunner(object):
+class BehaveTestRunner(object):
     def __init__(self, target):
-        """Check if behave and docker is installed properly"""
         self.target = os.path.abspath(target)
-        try:
-            # check that we have behave installed
-            from behave.__main__ import main as behave_main
-        except subprocess.CalledProcessError as ex:
-            raise CekitError("Test Runner needs 'behave' installed, '%s'" %
-                             ex.output)
-        except Exception as ex:
-            raise CekitError(
-                "Test Runner needs behave installed!", ex)
+
+    @staticmethod
+    def dependencies():
+        deps = {}
+
+        deps['python-behave'] = {
+            'library': 'behave',
+            'package': 'python2-behave',
+            'fedora': {
+                'package': 'python3-behave'}
+        }
+
+        return deps
 
     def run(self, image, run_tags, test_names):
         """Run test suite"""
@@ -57,8 +64,6 @@ class TestRunner(object):
                 args.append("~ci ")
 
         try:
-            from behave.__main__ import main as behave_main
-
             with Chdir(os.path.join(self.target, 'test')):
                 logger.debug("behave args: {}".format(args))
                 if behave_main(args) != 0:
diff --git a/cekit/test/behave.py b/cekit/test/behave_tester.py
similarity index 68%
rename from cekit/test/behave.py
rename to cekit/test/behave_tester.py
index cf71059..e7aef6b 100644
--- a/cekit/test/behave.py
+++ b/cekit/test/behave_tester.py
@@ -3,15 +3,15 @@ import os
 
 from cekit.builder import Command
 from cekit.generator.base import Generator
-from cekit.test.collector import TestCollector
-from cekit.test.runner import TestRunner
+from cekit.test.collector import BehaveTestCollector
+from cekit.test.behave_runner import BehaveTestRunner
 
 LOGGER = logging.getLogger('cekit')
 
 
 class BehaveTester(Command):
     """
-    Tested implementation for the Behave framework
+    Tester implementation for the Behave framework
     """
 
     def __init__(self, common_params, params):
@@ -21,8 +21,9 @@ class BehaveTester(Command):
         self.params = params
         self.collected = False
 
-        self.test_collector = TestCollector(os.path.dirname(self.common_params.descriptor),
+        self.test_collector = BehaveTestCollector(os.path.dirname(self.common_params.descriptor),
                                             self.common_params.target)
+        self.test_runner = BehaveTestRunner(self.common_params.target)
 
         self.generator = None
 
@@ -43,8 +44,10 @@ class BehaveTester(Command):
 
         if self.collected:
             # Handle test dependencies, if any
-            LOGGER.debug("Checking CEKit test dependencies...")
+            LOGGER.debug("Checking CEKit test collector dependencies...")
             self.dependency_handler.handle(self.test_collector)
+            LOGGER.debug("Checking CEKit test runner dependencies...")
+            self.dependency_handler.handle(self.test_runner)
 
     def run(self):
         if not self.collected:
@@ -57,6 +60,10 @@ class BehaveTester(Command):
         if self.params.wip:
             test_tags = ['@wip']
 
-        runner = TestRunner(self.common_params.target)
-        runner.run(self.params.image, test_tags,
-                   test_names=self.params.names)
+        image = self.params.image
+
+        if not image:
+            image = self.generator.get_tags()[0]
+
+        self.test_runner.run(image, test_tags,
+                             test_names=self.params.names)
diff --git a/cekit/test/collector.py b/cekit/test/collector.py
index db71fdc..6514939 100644
--- a/cekit/test/collector.py
+++ b/cekit/test/collector.py
@@ -7,7 +7,7 @@ import sys
 logger = logging.getLogger('cekit')
 
 
-class TestCollector(object):
+class BehaveTestCollector(object):
     def __init__(self, descriptor_dir, target_dir):
         self.collected = False
         self.descriptor_dir = os.path.abspath(descriptor_dir)
diff --git a/tests/test_integ_test_behave.py b/tests/test_integ_test_behave.py
new file mode 100644
index 0000000..b429772
--- /dev/null
+++ b/tests/test_integ_test_behave.py
@@ -0,0 +1,72 @@
+# -*- encoding: utf-8 -*-
+
+import os
+import shutil
+import tempfile
+
+import pytest
+import yaml
+
+from click.testing import CliRunner
+
+from cekit.cli import cli
+from cekit.tools import Chdir
+
+
+image_descriptor = {
+    'schema_version': 1,
+    'from': 'alpine:3.9',
+    'name': 'test/image',
+    'version': '1.0',
+    'labels': [{'name': 'foo', 'value': 'bar'}, {'name': 'labela', 'value': 'a'}],
+    'envs': [{'name': 'baz', 'value': 'qux'}, {'name': 'enva', 'value': 'a'}],
+    'run': {'cmd': ['tail', '-f', '/dev/null']},
+}
+
+
+@pytest.fixture(scope="module", name="test_image_dir")
+def build_test_image_dir():
+    image_dir = tempfile.mkdtemp(prefix="tmp-cekit-test")
+
+    with open(os.path.join(image_dir, 'image.yaml'), 'w') as fd:
+        yaml.dump(image_descriptor, fd, default_flow_style=False)
+
+    with Chdir(image_dir):
+        result = CliRunner().invoke(cli, ["-v", "build", "docker"], catch_exceptions=False)
+
+    assert result.exit_code == 0
+
+    return image_dir
+
+
+@pytest.fixture(autouse=True)
+def clean_target_directory(test_image_dir):
+    shutil.rmtree(os.path.join(test_image_dir, 'target'), ignore_errors=True)
+
+
+def test_execute_simple_behave_test(test_image_dir):
+    feature = """@test
+Feature: Basic tests
+
+  Scenario: Check that the labels are correctly set
+    Given image is built
+    Then the image should contain label foo with value bar
+     And the image should contain label labela with value a
+    """
+
+    features_dir = os.path.join(test_image_dir, 'tests', 'features')
+
+    os.makedirs(features_dir)
+
+    with open(os.path.join(features_dir, 'basic.feature'), 'w') as fd:
+        fd.write(feature)
+
+    with Chdir(test_image_dir):
+        result = CliRunner().invoke(cli, ["-v", "test", "behave"], catch_exceptions=False)
+
+    print(result.output)
+
+    assert result.exit_code == 0
+    assert "1 feature passed, 0 failed, 0 skipped" in result.output
+    assert "1 scenario passed, 0 failed, 0 skipped" in result.output
+    assert "3 steps passed, 0 failed, 0 skipped, 0 undefined" in result.output
diff --git a/tests/test_unit_args.py b/tests/test_unit_args.py
index 96611c3..5488bc5 100644
--- a/tests/test_unit_args.py
+++ b/tests/test_unit_args.py
@@ -118,7 +118,7 @@ def get_class_by_name(clazz):
     ),
     (
         ['test', '--image', 'image:1.0', 'behave'],
-        'cekit.test.behave.BehaveTester',
+        'cekit.test.behave_tester.BehaveTester',
         {
             'descriptor': 'image.yaml', 'verbose': False, 'work_dir': '~/.cekit', 'config': '~/.cekit/config', 'redhat': False, 'target': 'target'
         },
diff --git a/tests/test_unit_collector.py b/tests/test_unit_collector.py
index 599b317..8877f35 100644
--- a/tests/test_unit_collector.py
+++ b/tests/test_unit_collector.py
@@ -2,7 +2,7 @@ import os
 import shutil
 import pytest
 
-from cekit.test.collector import TestCollector
+from cekit.test.collector import BehaveTestCollector
 
 desc_dir = "/tmp/desc"
 target_dir = "/tmp/target_dir"
@@ -19,8 +19,8 @@ def prepare_dirs():
 
 
 def test_collect_test_from_image_repo(prepare_dirs, mocker):
-    mocker.patch.object(TestCollector, '_fetch_steps')
-    collector = TestCollector(desc_dir, target_dir)
+    mocker.patch.object(BehaveTestCollector, '_fetch_steps')
+    collector = BehaveTestCollector(desc_dir, target_dir)
 
     features_file = os.path.join(desc_dir,
                                  'tests',
@@ -41,8 +41,8 @@ def test_collect_test_from_image_repo(prepare_dirs, mocker):
 
 
 def test_collect_test_from_repository_root(prepare_dirs, mocker):
-    mocker.patch.object(TestCollector, '_fetch_steps')
-    collector = TestCollector(desc_dir, target_dir)
+    mocker.patch.object(BehaveTestCollector, '_fetch_steps')
+    collector = BehaveTestCollector(desc_dir, target_dir)
 
     features_file = os.path.join(target_dir,
                                  'repo',
@@ -65,8 +65,8 @@ def test_collect_test_from_repository_root(prepare_dirs, mocker):
 
 
 def test_collect_test_from_module(prepare_dirs, mocker):
-    mocker.patch.object(TestCollector, '_fetch_steps')
-    collector = TestCollector(desc_dir, target_dir)
+    mocker.patch.object(BehaveTestCollector, '_fetch_steps')
+    collector = BehaveTestCollector(desc_dir, target_dir)
 
     features_file = os.path.join(target_dir,
                                  'image',
@@ -90,9 +90,9 @@ def test_collect_test_from_module(prepare_dirs, mocker):
 
 
 def test_collect_return_false(prepare_dirs, mocker):
-    mocker.patch.object(TestCollector, '_fetch_steps')
+    mocker.patch.object(BehaveTestCollector, '_fetch_steps')
 
-    collector = TestCollector(desc_dir, target_dir)
+    collector = BehaveTestCollector(desc_dir, target_dir)
 
     assert not collector.collect('1', steps_url)