mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
Move some more tests out of root functional folder (#15753)
This commit is contained in:
19
awx/main/tests/functional/models/test_ha.py
Normal file
19
awx/main/tests/functional/models/test_ha.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
|
||||
# AWX
|
||||
from awx.main.ha import is_ha_environment
|
||||
from awx.main.models.ha import Instance
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_multiple_instances():
|
||||
for i in range(2):
|
||||
Instance.objects.create(hostname=f'foo{i}', node_type='hybrid')
|
||||
assert is_ha_environment()
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_db_localhost():
|
||||
Instance.objects.create(hostname='foo', node_type='hybrid')
|
||||
Instance.objects.create(hostname='bar', node_type='execution')
|
||||
assert is_ha_environment() is False
|
||||
Reference in New Issue
Block a user