]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: black-format the file test_enclosure.py
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 10 Jun 2024 18:32:34 +0000 (14:32 -0400)
committerAdam King <adking@redhat.com>
Fri, 7 Feb 2025 20:40:31 +0000 (15:40 -0500)
A bunch of stray whitespace in this file called out to be cleaned up.
Black did that job and fixed up some other formatting stuff.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit f6670b2d252e9d4db259bd35af86e89615e963dc)

src/cephadm/tests/test_enclosure.py

index 64643e4c224a27ed8ffc6a1899ead3295be3aecd..8c23d633b6f92049e3291a4cadce817e9a173d4b 100644 (file)
@@ -11,7 +11,8 @@ def enclosure(host_sysfs):
     e = _cephadm.Enclosure(
         enc_id='1',
         enc_path='/sys/class/scsi_generic/sg2/device/enclosure/0:0:1:0',
-        dev_path='/sys/class/scsi_generic/sg2')
+        dev_path='/sys/class/scsi_generic/sg2',
+    )
     yield e
 
 
@@ -19,7 +20,7 @@ class TestEnclosure:
 
     def test_enc_metadata(self, enclosure):
         """Check metadata for the enclosure e.g. vendor and model"""
-       
+
         assert enclosure.vendor == "EnclosuresInc"
         assert enclosure.components == '12'
         assert enclosure.model == "D12"
@@ -36,14 +37,19 @@ class TestEnclosure:
     def test_enc_slot_format(self, enclosure):
         """Check the attributes of a slot are as expected"""
 
-        assert all(k in ['fault', 'locate', 'serial', 'status'] 
-                   for k, _v in enclosure.slot_map['0'].items())
+        assert all(
+            k in ['fault', 'locate', 'serial', 'status']
+            for k, _v in enclosure.slot_map['0'].items()
+        )
 
     def test_enc_slot_status(self, enclosure):
         """Check the number of occupied slots is correct"""
 
-        occupied_slots = [slot_id for slot_id in enclosure.slot_map 
-                          if enclosure.slot_map[slot_id].get('status').upper() == 'OK']
+        occupied_slots = [
+            slot_id
+            for slot_id in enclosure.slot_map
+            if enclosure.slot_map[slot_id].get('status').upper() == 'OK'
+        ]
 
         assert len(occupied_slots) == 6
 
@@ -55,15 +61,18 @@ class TestEnclosure:
 
     def test_enc_device_serial(self, enclosure):
         """Check the device serial numbers are as expected"""
-        
-        assert all(fake_serial in enclosure.device_lookup.keys() 
-                   for fake_serial in [
-                       'fake000',
-                       'fake001',
-                       'fake002',
-                       'fake003',
-                       'fake004',
-                       'fake005'])
+
+        assert all(
+            fake_serial in enclosure.device_lookup.keys()
+            for fake_serial in [
+                'fake000',
+                'fake001',
+                'fake002',
+                'fake003',
+                'fake004',
+                'fake005',
+            ]
+        )
 
     def test_enc_slot_to_serial(self, enclosure):
         """Check serial number to slot matches across slot_map and device_lookup"""