Skip to content

Commit f44f28f

Browse files
committed
PEP8 fixes
1 parent a6114bb commit f44f28f

File tree

6 files changed

+18
-4
lines changed

6 files changed

+18
-4
lines changed

project/lib/options.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from argparse import ArgumentParser
22

3+
34
class Options:
45

56
def __init__(self):
@@ -8,7 +9,11 @@ def __init__(self):
89
def _init_parser(self):
910
usage = 'bin/project'
1011
self.parser = ArgumentParser(usage=usage)
11-
self.parser.add_argument('-x', '--example', default='example-value', dest='example', help='An example option')
12+
self.parser.add_argument('-x',
13+
'--example',
14+
default='example-value',
15+
dest='example',
16+
help='An example option')
1217

13-
def parse(self, args = None):
18+
def parse(self, args=None):
1419
return self.parser.parse_args(args)

project/lib/process.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import subprocess
22
import shlex
33

4+
45
class Process:
56

67
def __init__(self):
78
pass
89

910
def execute(self, command):
10-
process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
11+
process = subprocess.Popen(shlex.split(command),
12+
stdout=subprocess.PIPE,
13+
stderr=subprocess.PIPE)
1114
out, err = process.communicate()
1215
if process.returncode:
1316
raise ProcessException(process.returncode)

project/lib/project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from process import Process
22

3+
34
class Project:
45

56
def __init__(self, options):

project/tests/test_options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from lib import Options
44

5+
56
class TestCommandLineParameters(unittest.TestCase):
67

78
def setUp(self):

project/tests/test_process.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from lib import Process, ProcessException
44

5+
56
class TestProcess(unittest.TestCase):
67

78
def setUp(self):
@@ -11,4 +12,6 @@ def test_should_execute_successfully(self):
1112
self.assertEquals(self.process.execute("echo test"), "test\n")
1213

1314
def test_should_raise_exception_on_failed_execution(self):
14-
self.assertRaises(ProcessException, self.process.execute, "sh -c 'return 1'")
15+
self.assertRaises(ProcessException,
16+
self.process.execute,
17+
"sh -c 'return 1'")

project/tests/test_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from lib import Options
44
from lib import Project
55

6+
67
class TestProject(unittest.TestCase):
78
def _default_options(self):
89
options = Options()

0 commit comments

Comments
 (0)