Skip to content

Commit 07b71d6

Browse files
style: format code with Black
This commit fixes the style issues introduced in 9ecaf4f according to the output from Black. Details: #124
1 parent 9ecaf4f commit 07b71d6

File tree

1 file changed

+99
-74
lines changed

1 file changed

+99
-74
lines changed

tests/test_main.py

Lines changed: 99 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Tests for main.py."""
2-
#pylint: disable=import-error, wrong-import-position, unused-argument, line-too-long
2+
# pylint: disable=import-error, wrong-import-position, unused-argument, line-too-long
33

44
import sys
55
import os
@@ -10,114 +10,139 @@
1010
import main
1111

1212

13-
@patch('builtins.input', side_effect=["newpiece", "Brick", "Red", "5"])
14-
@patch('builtins.print')
13+
@patch("builtins.input", side_effect=["newpiece", "Brick", "Red", "5"])
14+
@patch("builtins.print")
1515
def test_lego_cmd_newpiece(self, mock_print):
1616
"""Test the newpiece command."""
1717
main.lego_cmd()
18-
mock_print.assert_has_calls([
19-
call('LEGO CMD: '),
20-
call('Name the piece you would like to add: '),
21-
call('What is the piece colour (make sure this colour is in the colour database, otherwise add using "newcolour")? '),
22-
call('How many of that would you like to add? ')
23-
])
24-
25-
26-
@patch('builtins.input', side_effect=["newcolour", "Red"])
27-
@patch('builtins.print')
18+
mock_print.assert_has_calls(
19+
[
20+
call("LEGO CMD: "),
21+
call("Name the piece you would like to add: "),
22+
call(
23+
'What is the piece colour (make sure this colour is in the colour database, otherwise add using "newcolour")? '
24+
),
25+
call("How many of that would you like to add? "),
26+
]
27+
)
28+
29+
30+
@patch("builtins.input", side_effect=["newcolour", "Red"])
31+
@patch("builtins.print")
2832
def test_lego_cmd_newcolour(self, mock_print):
2933
"""Test the newcolour command."""
3034
main.lego_cmd()
31-
mock_print.assert_has_calls([
32-
call('LEGO CMD: '),
33-
call('Name the colour you would like to add: '),
34-
])
35+
mock_print.assert_has_calls(
36+
[
37+
call("LEGO CMD: "),
38+
call("Name the colour you would like to add: "),
39+
]
40+
)
3541

3642

37-
@patch('builtins.input', side_effect=["newcolor", "Red"])
38-
@patch('builtins.print')
43+
@patch("builtins.input", side_effect=["newcolor", "Red"])
44+
@patch("builtins.print")
3945
def test_lego_cmd_newcolor(self, mock_print):
4046
"""Test the newcolor command."""
4147
main.lego_cmd()
42-
mock_print.assert_has_calls([
43-
call('LEGO CMD: '),
44-
call('Name the color you would like to add: '),
45-
])
48+
mock_print.assert_has_calls(
49+
[
50+
call("LEGO CMD: "),
51+
call("Name the color you would like to add: "),
52+
]
53+
)
4654

4755

48-
@patch('builtins.input', side_effect=["addpiece", "Brick", "Red", "5"])
49-
@patch('builtins.print')
56+
@patch("builtins.input", side_effect=["addpiece", "Brick", "Red", "5"])
57+
@patch("builtins.print")
5058
def test_lego_cmd_addpiece(self, mock_print):
5159
"""Test the addpiece command."""
5260
main.lego_cmd()
53-
mock_print.assert_has_calls([
54-
call('LEGO CMD: '),
55-
call('What is the name of the piece that you would like to add to? '),
56-
call('What is the piece colour? '),
57-
call('How many of that piece do you want to add? ')
58-
])
59-
60-
61-
@patch('builtins.input', side_effect=["removepiece", "Brick", "Red", "5"])
62-
@patch('builtins.print')
61+
mock_print.assert_has_calls(
62+
[
63+
call("LEGO CMD: "),
64+
call("What is the name of the piece that you would like to add to? "),
65+
call("What is the piece colour? "),
66+
call("How many of that piece do you want to add? "),
67+
]
68+
)
69+
70+
71+
@patch("builtins.input", side_effect=["removepiece", "Brick", "Red", "5"])
72+
@patch("builtins.print")
6373
def test_lego_cmd_removepiece(self, mock_print):
6474
"""Test the removepiece command."""
6575
main.lego_cmd()
66-
mock_print.assert_has_calls([
67-
call('LEGO CMD: '),
68-
call('What is the name of the piece that you would like to remove? '),
69-
call('What is the piece colour? '),
70-
call('How many of that piece do you want to remove? ')
71-
])
72-
73-
74-
@patch('builtins.input', side_effect=["newset", "Police Station", "123456", "City", "100", "5"])
75-
@patch('builtins.print')
76+
mock_print.assert_has_calls(
77+
[
78+
call("LEGO CMD: "),
79+
call("What is the name of the piece that you would like to remove? "),
80+
call("What is the piece colour? "),
81+
call("How many of that piece do you want to remove? "),
82+
]
83+
)
84+
85+
86+
@patch(
87+
"builtins.input",
88+
side_effect=["newset", "Police Station", "123456", "City", "100", "5"],
89+
)
90+
@patch("builtins.print")
7691
def test_lego_cmd_newset(self, mock_print):
7792
"""Test the newset command."""
7893
main.lego_cmd()
79-
mock_print.assert_has_calls([
80-
call('LEGO CMD: '),
81-
call('Name the set you would like to add: '),
82-
call('What is the set number for the set you would like to add? '),
83-
call('What is the theme for the set you would like to add? \
94+
mock_print.assert_has_calls(
95+
[
96+
call("LEGO CMD: "),
97+
call("Name the set you would like to add: "),
98+
call("What is the set number for the set you would like to add? "),
99+
call(
100+
'What is the theme for the set you would like to add? \
84101
(make sure this theme is in the database, \
85-
otherwise add using "newtheme") '),
86-
call('How many pieces are there in this set? '),
87-
call('How many of this set would you like to add? ')
88-
])
102+
otherwise add using "newtheme") '
103+
),
104+
call("How many pieces are there in this set? "),
105+
call("How many of this set would you like to add? "),
106+
]
107+
)
89108

90109

91-
@patch('builtins.input', side_effect=["newtheme", "City"])
92-
@patch('builtins.print')
110+
@patch("builtins.input", side_effect=["newtheme", "City"])
111+
@patch("builtins.print")
93112
def test_lego_cmd_newtheme(self, mock_print):
94113
"""Test the newtheme command."""
95114
main.lego_cmd()
96-
mock_print.assert_has_calls([
97-
call('LEGO CMD: '),
98-
call('Name the theme you would like to add: '),
99-
])
115+
mock_print.assert_has_calls(
116+
[
117+
call("LEGO CMD: "),
118+
call("Name the theme you would like to add: "),
119+
]
120+
)
100121

101122

102-
@patch('builtins.input', side_effect=["addset", "123456", "5"])
103-
@patch('builtins.print')
123+
@patch("builtins.input", side_effect=["addset", "123456", "5"])
124+
@patch("builtins.print")
104125
def test_lego_cmd_addset(self, mock_print):
105126
"""Test the addset command."""
106127
main.lego_cmd()
107-
mock_print.assert_has_calls([
108-
call('LEGO CMD: '),
109-
call('What is the set number of the set that you would like to add? '),
110-
call('How many of that set do you want to add? ')
111-
])
128+
mock_print.assert_has_calls(
129+
[
130+
call("LEGO CMD: "),
131+
call("What is the set number of the set that you would like to add? "),
132+
call("How many of that set do you want to add? "),
133+
]
134+
)
112135

113136

114-
@patch('builtins.input', side_effect=["removeset", "123456", "5"])
115-
@patch('builtins.print')
137+
@patch("builtins.input", side_effect=["removeset", "123456", "5"])
138+
@patch("builtins.print")
116139
def test_lego_cmd_removeset(self, mock_print):
117140
"""Test the removeset command."""
118141
main.lego_cmd()
119-
mock_print.assert_has_calls([
120-
call('LEGO CMD: '),
121-
call('What is the set number of the set that you would like to remove? '),
122-
call('How many of that set do you want to remove? ')
123-
])
142+
mock_print.assert_has_calls(
143+
[
144+
call("LEGO CMD: "),
145+
call("What is the set number of the set that you would like to remove? "),
146+
call("How many of that set do you want to remove? "),
147+
]
148+
)

0 commit comments

Comments
 (0)