mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
more whitespace
This commit is contained in:
@@ -44,11 +44,11 @@ class TestInventory(unittest.TestCase):
|
||||
inventory = self.simple_inventory()
|
||||
hosts = inventory.list_hosts()
|
||||
|
||||
expected_hosts=['jupiter', 'saturn', 'zeus', 'hera',
|
||||
expected_hosts=['jupiter', 'saturn', 'zeus', 'hera',
|
||||
'cerberus001','cerberus002','cerberus003',
|
||||
'cottus99', 'cottus100',
|
||||
'poseidon', 'thor', 'odin', 'loki',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir3', 'thrudgelmir4', 'thrudgelmir5']
|
||||
assert sorted(hosts) == sorted(expected_hosts)
|
||||
|
||||
@@ -56,11 +56,11 @@ class TestInventory(unittest.TestCase):
|
||||
inventory = self.simple_inventory()
|
||||
hosts = inventory.list_hosts('all')
|
||||
|
||||
expected_hosts=['jupiter', 'saturn', 'zeus', 'hera',
|
||||
expected_hosts=['jupiter', 'saturn', 'zeus', 'hera',
|
||||
'cerberus001','cerberus002','cerberus003',
|
||||
'cottus99', 'cottus100',
|
||||
'poseidon', 'thor', 'odin', 'loki',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir3', 'thrudgelmir4', 'thrudgelmir5']
|
||||
assert sorted(hosts) == sorted(expected_hosts)
|
||||
|
||||
@@ -75,8 +75,8 @@ class TestInventory(unittest.TestCase):
|
||||
inventory = self.simple_inventory()
|
||||
hosts = inventory.list_hosts("ungrouped")
|
||||
|
||||
expected_hosts=['jupiter', 'saturn',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
expected_hosts=['jupiter', 'saturn',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir3', 'thrudgelmir4', 'thrudgelmir5']
|
||||
assert sorted(hosts) == sorted(expected_hosts)
|
||||
|
||||
@@ -84,7 +84,7 @@ class TestInventory(unittest.TestCase):
|
||||
inventory = self.simple_inventory()
|
||||
hosts = inventory.list_hosts("norse:greek")
|
||||
|
||||
expected_hosts=['zeus', 'hera', 'poseidon',
|
||||
expected_hosts=['zeus', 'hera', 'poseidon',
|
||||
'cerberus001','cerberus002','cerberus003',
|
||||
'cottus99','cottus100',
|
||||
'thor', 'odin', 'loki']
|
||||
@@ -94,7 +94,7 @@ class TestInventory(unittest.TestCase):
|
||||
inventory = self.simple_inventory()
|
||||
|
||||
restricted_hosts = ['hera', 'poseidon', 'thor']
|
||||
expected_hosts=['zeus', 'hera', 'poseidon',
|
||||
expected_hosts=['zeus', 'hera', 'poseidon',
|
||||
'cerberus001','cerberus002','cerberus003',
|
||||
'cottus99', 'cottus100',
|
||||
'thor', 'odin', 'loki']
|
||||
@@ -118,13 +118,13 @@ class TestInventory(unittest.TestCase):
|
||||
|
||||
hosts = inventory.list_hosts("all:!greek")
|
||||
expected_hosts=['jupiter', 'saturn', 'thor', 'odin', 'loki',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir3', 'thrudgelmir4', 'thrudgelmir5']
|
||||
assert sorted(hosts) == sorted(expected_hosts)
|
||||
|
||||
hosts = inventory.list_hosts("all:!norse:!greek")
|
||||
expected_hosts=['jupiter', 'saturn',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2',
|
||||
'thrudgelmir3', 'thrudgelmir4', 'thrudgelmir5']
|
||||
assert sorted(hosts) == sorted(expected_hosts)
|
||||
|
||||
@@ -159,8 +159,8 @@ class TestInventory(unittest.TestCase):
|
||||
print vars
|
||||
|
||||
expected = dict(
|
||||
a='1', b='2', c='3', d='100002', rga='1', rgb='2', rgc='3',
|
||||
inventory_hostname='rtp_a', inventory_hostname_short='rtp_a',
|
||||
a='1', b='2', c='3', d='100002', rga='1', rgb='2', rgc='3',
|
||||
inventory_hostname='rtp_a', inventory_hostname_short='rtp_a',
|
||||
group_names=[ 'eastcoast', 'nc', 'redundantgroup', 'redundantgroup2', 'redundantgroup3', 'rtp', 'us' ]
|
||||
)
|
||||
print vars
|
||||
|
||||
@@ -32,7 +32,7 @@ class TestCallbacks(object):
|
||||
|
||||
def on_setup(self):
|
||||
EVENTS.append([ 'primary_setup' ])
|
||||
|
||||
|
||||
def on_skipped(self, host, item=None):
|
||||
EVENTS.append([ 'skipped', [ host ]])
|
||||
|
||||
@@ -65,7 +65,7 @@ class TestCallbacks(object):
|
||||
del host_result[k]
|
||||
for k in host_result.keys():
|
||||
if k.startswith('facter_') or k.startswith('ohai_'):
|
||||
del host_result[k]
|
||||
del host_result[k]
|
||||
EVENTS.append([ 'ok', [ host, host_result ]])
|
||||
|
||||
def on_play_start(self, pattern):
|
||||
@@ -85,7 +85,7 @@ class TestCallbacks(object):
|
||||
|
||||
def on_setup(self):
|
||||
pass
|
||||
|
||||
|
||||
def on_no_hosts(self):
|
||||
pass
|
||||
|
||||
@@ -116,7 +116,7 @@ class TestPlaybook(unittest.TestCase):
|
||||
filename = os.path.join(self.test_dir, filename)
|
||||
assert os.path.exists(filename)
|
||||
return filename
|
||||
|
||||
|
||||
def _get_stage_file(self, filename):
|
||||
# get a file inside the test output directory
|
||||
filename = os.path.join(self.stage_dir, filename)
|
||||
@@ -144,15 +144,15 @@ class TestPlaybook(unittest.TestCase):
|
||||
pb = os.path.join(self.test_dir, 'playbook1.yml')
|
||||
actual = self._run(pb)
|
||||
|
||||
# if different, this will output to screen
|
||||
# if different, this will output to screen
|
||||
print "**ACTUAL**"
|
||||
print utils.jsonify(actual, format=True)
|
||||
expected = {
|
||||
expected = {
|
||||
"127.0.0.2": {
|
||||
"changed": 9,
|
||||
"failures": 0,
|
||||
"ok": 11,
|
||||
"skipped": 1,
|
||||
"changed": 9,
|
||||
"failures": 0,
|
||||
"ok": 11,
|
||||
"skipped": 1,
|
||||
"unreachable": 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
---
|
||||
- hosts: all
|
||||
|
||||
# the 'weasels' string should show up in the output
|
||||
# the 'weasels' string should show up in the output
|
||||
|
||||
vars:
|
||||
answer: "Wuh, I think so, Brain, but if we didn't have ears, we'd look like weasels."
|
||||
@@ -14,7 +14,7 @@
|
||||
vars_files:
|
||||
- common_vars.yml
|
||||
- [ '$facter_operatingsystem.yml', 'default_os.yml' ]
|
||||
|
||||
|
||||
tasks:
|
||||
|
||||
- name: test basic success command
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
- name: test copy
|
||||
action: copy src=sample.j2 dest=/tmp/ansible_test_data_copy.out
|
||||
notify:
|
||||
notify:
|
||||
- on change 1
|
||||
|
||||
# this should trigger two change handlers, but the 2nd should
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
- name: test template
|
||||
action: template src=sample.j2 dest=/tmp/ansible_test_data_template.out
|
||||
notify:
|
||||
notify:
|
||||
- on change 1
|
||||
- on change 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user