Browse Source

Minor code style formattings

tags/0.3
Johann Schmitz 3 years ago
parent
commit
4b98505bec
2 changed files with 6 additions and 3 deletions
  1. 1
    0
      src/smartcheck/check.py
  2. 5
    3
      tests/parsing.py

+ 1
- 0
src/smartcheck/check.py View File

@@ -28,6 +28,7 @@ DATA_ATTRIBUTES_RE = re.compile(r"\s*(\d+)\s+([\w\d_\-]+)\s+([0-9a-fx]+)\s+(\d+)
28 28
 
29 29
 TEST_RESULT_RE = re.compile(r"#\s*(\d+)\s+(.*?)\s{2,}(.*?)\s{2,}\s+([\d%]+)\s+(\d+)\s+(\d+|-)", re.UNICODE)
30 30
 
31
+
31 32
 def toint(s, default=0):
32 33
 	try:
33 34
 		return int(s)

+ 5
- 3
tests/parsing.py View File

@@ -1,14 +1,15 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 try:
3
-    from StringIO import StringIO
3
+	from StringIO import StringIO
4 4
 except ImportError:
5
-    from io import StringIO
5
+	from io import StringIO
6 6
 import os
7 7
 import unittest
8 8
 from smartcheck.check import SMARTCheck
9 9
 
10 10
 samples_path = os.path.join(os.path.dirname(__file__), 'samples')
11 11
 
12
+
12 13
 class InformationBlockParsingTest(unittest.TestCase):
13 14
 
14 15
 	def test_parsing(self):
@@ -37,7 +38,7 @@ class InformationBlockParsingTest(unittest.TestCase):
37 38
 				check = SMARTCheck(f)
38 39
 				self.assertDictEqual(check.information, expected_data)
39 40
 
40
-	def test_information_section_missing(self):
41
+	def test_information_section_missing_empty(self):
41 42
 		check = SMARTCheck(StringIO(""))
42 43
 		self.assertDictEqual(check.information, {})
43 44
 
@@ -46,6 +47,7 @@ class InformationBlockParsingTest(unittest.TestCase):
46 47
 			check = SMARTCheck(f)
47 48
 			self.assertDictEqual(check.information, {})
48 49
 
50
+
49 51
 class SMARTDataParsingTest(unittest.TestCase):
50 52
 	def test_parsing(self):
51 53
 		for filename, overall_health, attributes in [

Loading…
Cancel
Save