-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix flake8 errors in Kubespray CI - tox-inventory-builder #6910
Changes from all commits
bbc8818
2721051
eb16378
817754d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -51,7 +51,7 @@ def test_ensure_required_groups(self): | |||||
groups = ['group1', 'group2'] | ||||||
self.inv.ensure_required_groups(groups) | ||||||
for group in groups: | ||||||
self.assertTrue(group in self.inv.yaml_config['all']['children']) | ||||||
self.assertIn(group, self.inv.yaml_config['all']['children']) | ||||||
|
||||||
def test_get_host_id(self): | ||||||
hostnames = ['node99', 'no99de01', '01node01', 'node1.domain', | ||||||
|
@@ -209,8 +209,8 @@ def test_purge_invalid_hosts(self): | |||||
('doesnotbelong2', {'whateveropts=ilike'})]) | ||||||
self.inv.yaml_config['all']['hosts'] = existing_hosts | ||||||
self.inv.purge_invalid_hosts(proper_hostnames) | ||||||
self.assertTrue( | ||||||
bad_host not in self.inv.yaml_config['all']['hosts'].keys()) | ||||||
self.assertNotIn( | ||||||
bad_host, self.inv.yaml_config['all']['hosts'].keys()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that this works without having to specify the keys() method
Suggested change
|
||||||
|
||||||
def test_add_host_to_group(self): | ||||||
group = 'etcd' | ||||||
|
@@ -227,8 +227,8 @@ def test_set_kube_master(self): | |||||
host = 'node1' | ||||||
|
||||||
self.inv.set_kube_master([host]) | ||||||
self.assertTrue( | ||||||
host in self.inv.yaml_config['all']['children'][group]['hosts']) | ||||||
self.assertIn( | ||||||
host, self.inv.yaml_config['all']['children'][group]['hosts']) | ||||||
|
||||||
def test_set_all(self): | ||||||
hosts = OrderedDict([ | ||||||
|
@@ -246,25 +246,25 @@ def test_set_k8s_cluster(self): | |||||
|
||||||
self.inv.set_k8s_cluster() | ||||||
for host in expected_hosts: | ||||||
self.assertTrue( | ||||||
host in | ||||||
self.assertIn( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same suggestion as the first comment
|
||||||
host, | ||||||
self.inv.yaml_config['all']['children'][group]['children']) | ||||||
|
||||||
def test_set_kube_node(self): | ||||||
group = 'kube-node' | ||||||
host = 'node1' | ||||||
|
||||||
self.inv.set_kube_node([host]) | ||||||
self.assertTrue( | ||||||
host in self.inv.yaml_config['all']['children'][group]['hosts']) | ||||||
self.assertIn( | ||||||
host, self.inv.yaml_config['all']['children'][group]['hosts']) | ||||||
|
||||||
def test_set_etcd(self): | ||||||
group = 'etcd' | ||||||
host = 'node1' | ||||||
|
||||||
self.inv.set_etcd([host]) | ||||||
self.assertTrue( | ||||||
host in self.inv.yaml_config['all']['children'][group]['hosts']) | ||||||
self.assertIn( | ||||||
host, self.inv.yaml_config['all']['children'][group]['hosts']) | ||||||
|
||||||
def test_scale_scenario_one(self): | ||||||
num_nodes = 50 | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about something that doesn't iterate over the groups like:
self.assertTrue(set(groups).issuperset(set(self.inv.yaml_config['all']['children'])))