B
    `                 @   s:   d dl Zd dlm  mZ d dlZdZejj	dd Z
dS )    N)pytesterc             C   s"   |  d |  }|jdd dS )z;Test the fixtures supplied by the pytest_plugin module
    ap  
        from pgwui_develop import pytest_plugin_helpers
        import pytest

        from unittest import mock

        from pyramid.config import (
            Configurator
        )
        from pyramid.threadlocal import (
            get_current_request
        )


        # Activiate our pytest plugin
        pytest_plugins = ("pgwui_develop",)

        # pyramid_config

        def test_pyramid_config(pyramid_config):
            # A pyramid_config is a Configurator instance
            result = pyramid_config
            assert isinstance(result, Configurator)


        # pyramid_test_config

        def test_pyramid_request_config(pyramid_request_config):
            # Is a Configurator instance and has a non-None request
            result = pyramid_request_config
            assert isinstance(result, Configurator)
            assert get_current_request() is not None


        @pytest.fixture
        def mock_pgwui_entry_point(monkeypatch):
            mocked = mock.Mock(
                spec=getattr(pytest_plugin_helpers, 'pgwui_entry_point'),
                name='pgwui_entry_point')
            monkeypatch.setattr(pytest_plugin_helpers, 'pgwui_entry_point',
                                 mocked)
            return mocked


        # pgwui_component_entry_point

        def test_pgwui_component_entry_point(
                mock_pgwui_entry_point, pgwui_component_entry_point):
            #Calls pgwui_entry_point

            pgwui_component_entry_point('pgwui_example')
            mock_pgwui_entry_point.assert_called_once()


        # pgwui_check_settings_entry_point

        def test_pgwui_check_settings_entry_point(
                mock_pgwui_entry_point, pgwui_check_settings_entry_point):
            #Calls pgwui_entry_point

            pgwui_check_settings_entry_point('pgwui_example')
            mock_pgwui_entry_point.assert_called_once()


           )passedN)
makepyfile	runpytestassert_outcomes)testdirresult r
   V/home/kop/projects/devel/pgwui/pgwui_develop/PGWUI_Develop/tests/test_pytest_plugin.pytest_pgwui_develop_fixtures%   s    Ar   )builtins@py_builtins_pytest.assertion.rewrite	assertionrewrite
@pytest_arpytestpytest_pluginsmarkunittestr   r
   r
   r
   r   <module>   s     	