mirror of
https://github.com/ansible/awx.git
synced 2026-06-22 15:17:44 -02:30
Report single node clusters as non-ha (#11212)
* Report single node clusters as non-ha * Move test file so we can make it use the database * Update unit test to accomidate different node types
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
# Copyright (c) 2016 Ansible, Inc.
|
||||
|
||||
# Python
|
||||
from unittest import mock
|
||||
|
||||
# AWX
|
||||
from awx.main.ha import is_ha_environment
|
||||
|
||||
|
||||
@mock.patch('awx.main.models.Instance.objects.count', lambda: 2)
|
||||
def test_multiple_instances():
|
||||
assert is_ha_environment()
|
||||
|
||||
|
||||
@mock.patch('awx.main.models.Instance.objects.count', lambda: 1)
|
||||
def test_db_localhost():
|
||||
assert is_ha_environment() is False
|
||||
Reference in New Issue
Block a user