mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 14:09:28 -02:30
Mock Project.playbooks for functional tests.
This commit is contained in:
@@ -124,6 +124,18 @@ def team_member(user, team):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
|
def project_playbooks():
|
||||||
|
'''
|
||||||
|
Return playbook_files as playbooks for manual projects when testing.
|
||||||
|
'''
|
||||||
|
class PlaybooksMock(mock.PropertyMock):
|
||||||
|
def __get__(self, obj, obj_type):
|
||||||
|
return obj.playbook_files
|
||||||
|
mocked = mock.patch.object(Project, 'playbooks', new_callable=PlaybooksMock)
|
||||||
|
mocked.start()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@mock.patch.object(Project, "update", lambda self, **kwargs: None)
|
@mock.patch.object(Project, "update", lambda self, **kwargs: None)
|
||||||
def project(instance, organization):
|
def project(instance, organization):
|
||||||
|
|||||||
Reference in New Issue
Block a user