]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
tests: Refresh Python code
authorDaniel Wagner <dwagner@suse.de>
Thu, 3 Mar 2022 17:35:24 +0000 (18:35 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 3 Mar 2022 17:44:28 +0000 (18:44 +0100)
autopep3 and isort updated the code according the coding guidelines.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
tests/nvme_attach_detach_ns_test.py
tests/nvme_create_max_ns_test.py
tests/nvme_format_test.py
tests/nvme_fw_log_test.py
tests/nvme_get_features_test.py
tests/nvme_id_ns_test.py
tests/nvme_read_write_test.py
tests/nvme_test.py
tests/nvme_test_io.py
tests/nvme_test_logger.py
tests/nvme_writezeros_test.py

index 92a82dd035d15edc4097d8ea84f2e40bb4ea197f..5ba0d48040d0ab67fe98ab09b30d40f4e75a0488 100644 (file)
@@ -28,6 +28,7 @@ NVMe Namespace Management Testcase:-
 """
 
 import time
+
 from nose.tools import assert_equal
 from nvme_test import TestNVMe
 
index 33a66b7493a774f009cd27ac0c2b3f62626a89f4..3316eeca0ab28ab66fb3ce3ec850836ebc7f3ab3 100644 (file)
@@ -28,6 +28,7 @@ NVMe Namespace Management Testcase:-
 """
 
 import time
+
 from nose.tools import assert_equal
 from nvme_test import TestNVMe
 
@@ -50,7 +51,8 @@ class TestNVMeCreateMaxNS(TestNVMe):
         TestNVMe.__init__(self)
         self.dps = 0
         self.flbas = 0
-        self.nsze = int(self.get_ncap() / self.get_format() / self.get_max_ns())
+        self.nsze = int(self.get_ncap() /
+                        self.get_format() / self.get_max_ns())
         self.ncap = self.nsze
         self.setup_log_dir(self.__class__.__name__)
         self.max_ns = self.get_max_ns()
index 55092fa6b7e385a9ebac4191a71b1fc5f1605284..6a00ab626df3f61abbd891580349ab2d6a6d7965 100644 (file)
@@ -35,8 +35,9 @@ Namespace Format testcase :-
            - Delete Namespace.
 """
 
-import time
 import subprocess
+import time
+
 from nose.tools import assert_equal
 from nvme_test import TestNVMe
 
@@ -130,8 +131,8 @@ class TestNVMeFormatCmd(TestNVMe):
 
         # iterate through all supported format
         for i in range(0, len(self.lba_format_list)):
-            print("\nlba format " + str(self.lba_format_list[i]) + \
-                  " lbad       " + str(self.lbads_list[i]) + \
+            print("\nlba format " + str(self.lba_format_list[i]) +
+                  " lbad       " + str(self.lbads_list[i]) +
                   " ms         " + str(self.ms_list[i]))
             metadata_size = 1 if self.ms_list[i] == '8' else 0
             err = self.create_and_validate_ns(self.default_nsid,
index adb638634b5c1403ab2f12ab81046fb8c11ad3bf..a9c9afa56f64028822c91ceebb7b0461a28a0ab3 100644 (file)
@@ -25,6 +25,7 @@ NVMe Firmware Log Testcase :-
 """
 
 import subprocess
+
 from nose.tools import assert_equal
 from nvme_test import TestNVMe
 
index 2e407ef1e4da8fc6b399e66197acd5545a9263a0..e327bb0f1663211468be121f7d68608da4eb0335 100644 (file)
@@ -33,6 +33,7 @@ Test the Mandatory features with get features command:-
 """
 
 import subprocess
+
 from nose.tools import assert_equal
 from nvme_test import TestNVMe
 
index cf56187a1a386902765bd018393a33da0f34fa8f..12e7dc8937d6815529f3697410cd8e9aa51c8277 100644 (file)
@@ -26,6 +26,7 @@ NVme Identify Namespace Testcase:-
 """
 
 import subprocess
+
 from nose.tools import assert_equal
 from nvme_test import TestNVMe
 
@@ -78,7 +79,7 @@ class TestNVMeIdentifyNamespace(TestNVMe):
                 - 0 on success, error code on failure.
         """
         err = 0
-        for namespace  in self.ns_list:
+        for namespace in self.ns_list:
             err = self.get_id_ns(str(namespace))
         return err
 
index 4a04f8ad7e7347fad915707cae7fa48cf82c450d..528c79155c4c7de25263bf445880bb9e24812241 100644 (file)
@@ -27,6 +27,7 @@ NVMe Read/Write Testcae:-
 """
 
 import filecmp
+
 from nose.tools import assert_equal
 from nvme_test_io import TestNVMeIO
 
@@ -41,6 +42,7 @@ class TestNVMeReadWriteTest(TestNVMeIO):
               - compare_file : data file to use in nvme compare command.
               - test_log_dir : directory for logs, temp files.
     """
+
     def __init__(self):
         """ Pre Section for TestNVMeReadWriteTest """
         TestNVMeIO.__init__(self)
index b49c12f0b420a4bcfb6a8b1b67d5bae1cde96db5..5a5971ee03fddc61c37eb3f7bc5f817c5175d5af 100644 (file)
 """ Base class for all the testcases
 """
 
-import re
-import os
-import sys
 import json
 import mmap
-import stat
-import time
+import os
+import re
 import shutil
+import stat
 import subprocess
+import sys
+import time
+
 from nose import tools
 from nose.tools import assert_equal
 from nvme_test_logger import TestNVMeLogger
index 0c5c6bbdb478f8d601a7da63a9ba87d10359cc9f..aab502a7afe6d1198e0162109523537e13a33403 100644 (file)
@@ -20,6 +20,7 @@
 """ Inherit TestNVMeIO for nvme read/write operations """
 
 import os
+
 from nose import tools
 from nvme_test import TestNVMe
 
index c59fa185d341169d68143ab861a6347500135b71..5681628d72bdf4ce59d66136fb434e92a685cd86 100644 (file)
@@ -26,6 +26,7 @@ import sys
 
 class TestNVMeLogger(object):
     """ Represents Logger for NVMe Testframework.  """
+
     def __init__(self, log_file_path):
         """ Logger setup
             - Args:
index 157fd7807c7b942832337e6c47dde5eedf74e071..ba3538c9be067efade974a5f88d2d70ccf78532a 100644 (file)
@@ -28,6 +28,7 @@ NVMe Write Zeros:-
 """
 
 import filecmp
+
 from nose.tools import assert_equal
 from nvme_test_io import TestNVMeIO
 
@@ -44,6 +45,7 @@ class TestNVMeWriteZeros(TestNVMeIO):
               - block_count: Number of blocks to use in IO.
               - test_log_dir : directory for logs, temp files.
     """
+
     def __init__(self):
         """ Pre Section for TestNVMeWriteZeros """
         TestNVMeIO.__init__(self)