Parcourir la source

Fix pep8 errors found by hacking 2.0.0

Fixed the following issues found in pep8, now using hacking 2.0.0

[12313] /home/ffernand/work/openstack/networking-ovn.git$ /home/ffernand/work/openstack/networking-ovn.git/.tox/shared/bin/flake8
./networking_ovn/tests/functional/test_impl_idl.py:65:14: H205: Use assert{Greater,Less}[Equal]
        self.assertTrue(len(self.data['chassis']) <= len(mapping))
             ^
./networking_ovn/tests/functional/test_impl_idl.py:66:14: H205: Use assert{Greater,Less}[Equal]
        self.assertTrue(set(mapping.keys()) >=
             ^
./networking_ovn/tests/functional/test_impl_idl.py:72:14: H205: Use assert{Greater,Less}[Equal]
        self.assertTrue(our_chassis <= chassis_list)
             ^
./networking_ovn/tests/functional/test_impl_idl.py:88:14: H205: Use assert{Greater,Less}[Equal]
        self.assertTrue(len(self.data['chassis']) <= len(mapping))
             ^
./networking_ovn/tests/functional/test_impl_idl.py:89:14: H205: Use assert{Greater,Less}[Equal]
        self.assertTrue(set(mapping.keys()) >=
             ^
./networking_ovn/tests/functional/test_ovn_db_sync.py:260:25: F601 dictionary key 'dns_server' repeated with different values
                        'dns_server': '{10.10.10.10}',
                        ^
./networking_ovn/tests/functional/test_ovn_db_sync.py:266:25: F601 dictionary key 'dns_server' repeated with different values
                        'dns_server': '8.8.8.8'}})
                        ^

Change-Id: I9ed48b69c8c70254f77e2098ed4d6d78e71efcb1
Signed-off-by: Flavio Fernandes <flaviof@redhat.com>
tags/6.0.1
Flavio Fernandes il y a 5 mois
Parent
révision
a5e6938482
2 fichiers modifiés avec 7 ajouts et 8 suppressions
  1. +7
    -7
      networking_ovn/tests/functional/test_impl_idl.py
  2. +0
    -1
      networking_ovn/tests/functional/test_ovn_db_sync.py

+ 7
- 7
networking_ovn/tests/functional/test_impl_idl.py Voir le fichier

@@ -62,14 +62,14 @@ class TestSbApi(base.FunctionalTestCase):

def test_get_chassis_hostname_and_physnets(self):
mapping = self.api.get_chassis_hostname_and_physnets()
self.assertTrue(len(self.data['chassis']) <= len(mapping))
self.assertTrue(set(mapping.keys()) >=
{c['hostname'] for c in self.data['chassis']})
self.assertLessEqual(len(self.data['chassis']), len(mapping))
self.assertGreaterEqual(set(mapping.keys()),
{c['hostname'] for c in self.data['chassis']})

def test_get_all_chassis(self):
chassis_list = set(self.api.get_all_chassis())
our_chassis = {c['name'] for c in self.data['chassis']}
self.assertTrue(our_chassis <= chassis_list)
self.assertLessEqual(our_chassis, chassis_list)

def test_get_chassis_data_for_ml2_bind_port(self):
host = self.data['chassis'][0]['hostname']
@@ -85,9 +85,9 @@ class TestSbApi(base.FunctionalTestCase):

def test_get_chassis_and_physnets(self):
mapping = self.api.get_chassis_and_physnets()
self.assertTrue(len(self.data['chassis']) <= len(mapping))
self.assertTrue(set(mapping.keys()) >=
{c['name'] for c in self.data['chassis']})
self.assertLessEqual(len(self.data['chassis']), len(mapping))
self.assertGreaterEqual(set(mapping.keys()),
{c['name'] for c in self.data['chassis']})

def _add_switch_port(self, chassis_name, type='localport'):
sname, pname = (utils.get_rand_device_name(prefix=p)


+ 0
- 1
networking_ovn/tests/functional/test_ovn_db_sync.py Voir le fichier

@@ -257,7 +257,6 @@ class TestOvnNbSync(base.TestOVNFunctionalBase):
'{169.254.169.254/32,10.0.0.2, 0.0.0.0/0,10.0.0.1}',
'server_id': '10.0.0.1',
'server_mac': '01:02:03:04:05:06',
'dns_server': '{10.10.10.10}',
'lease_time': str(12 * 60 * 60),
'mtu': str(n1['network']['mtu']),
'router': n1_s1['subnet']['gateway_ip'],


Chargement…
Annuler
Enregistrer