mirror of
https://github.com/ansible/awx.git
synced 2026-07-08 06:48:04 -02:30
Sort cloud regions in a stable way
* All comes first * Then US regions * Then all other regions alphabetically
This commit is contained in:
@@ -174,3 +174,11 @@ def test_get_custom_venv_choices():
|
||||
with TemporaryDirectory(dir=settings.BASE_VENV_PATH) as temp_dir:
|
||||
os.makedirs(os.path.join(temp_dir, 'bin', 'activate'))
|
||||
assert common.get_custom_venv_choices() == [os.path.join(temp_dir, '')]
|
||||
|
||||
|
||||
def test_region_sorting():
|
||||
s = [('Huey', 'China1'),
|
||||
('Dewey', 'UK1'),
|
||||
('Lewie', 'US1'),
|
||||
('All', 'All')]
|
||||
assert [x[1] for x in sorted(s, key=common.region_sorting)] == ['All', 'US1', 'China1', 'UK1']
|
||||
|
||||
Reference in New Issue
Block a user