mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Mock Project.playbooks for functional tests.
This commit is contained in:
parent
558d80bec2
commit
4d372b1f90
@ -124,6 +124,18 @@ def team_member(user, team):
|
||||
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
|
||||
@mock.patch.object(Project, "update", lambda self, **kwargs: None)
|
||||
def project(instance, organization):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user