Skip to content

Commit 22c6655

Browse files
author
Alexey Bogoslovskyi
committed
Fix formatting
1 parent 5e9d0dc commit 22c6655

File tree

9 files changed

+88
-91
lines changed

9 files changed

+88
-91
lines changed

shellfoundry/utilities/cloudshell_api/client_wrapper.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,5 @@ def _create_client(self):
5858
msg = e.msg
5959
else:
6060
msg = "Please verify the credentials in the config"
61-
raise FatalError(
62-
"Login to CloudShell failed. {}".format(msg)
63-
)
61+
raise FatalError("Login to CloudShell failed. {}".format(msg))
6462
raise FatalError(self.ConnectionFailureMessage)

shellfoundry/utilities/template_retriever.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ def _get_local_templates(self, template_location):
104104
)
105105
else:
106106
standard_version = templ_data.get(
107-
"version",
108-
templ_data.get("shell_version", "0.0.1")
107+
"version", templ_data.get("shell_version", "0.0.1")
109108
)
110109

111110
templ_info.append(

tests/test_commands/test_extend_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_extend_incorrect_arguments(self):
4141

4242
with patch("shellfoundry.commands.extend_command.TempDirContext"):
4343
with self.assertRaisesRegex(
44-
BadParameter, u"Check correctness of entered attributes"
44+
BadParameter, "Check correctness of entered attributes"
4545
):
4646
self.tested_instance.extend("local:some_path", ("new_attribute",))
4747

@@ -105,7 +105,7 @@ def test_extend_from_remote_download_failed(self):
105105
def test_extend_not_2_gen_shell(self):
106106
with patch("shellfoundry.commands.extend_command.TempDirContext"):
107107
with self.assertRaisesRegex(
108-
ClickException, u"Invalid second generation Shell."
108+
ClickException, "Invalid second generation Shell."
109109
):
110110
self.tested_instance.extend("some_path", ("new_attribute",))
111111

tests/test_commands/test_install_command.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def test_install_gen1_shell_cs_connection_failed(self, os_mock, shell_package_mo
111111
# Assert
112112
self.mock_installer.install.assert_called_once()
113113
self.assertTrue(
114-
str(context.exception) == u"Connection to CloudShell Server failed. "
115-
u"Please make sure it is up and running properly."
114+
str(context.exception) == "Connection to CloudShell Server failed. "
115+
"Please make sure it is up and running properly."
116116
)
117117

118118
@patch("shellfoundry.commands.install_command.ShellPackage")
@@ -139,7 +139,7 @@ def test_install_gen1_shell_cs_login_failed(self, os_mock, shell_package_mock):
139139
self.mock_installer.install.assert_called_once()
140140
self.assertTrue(
141141
str(context.exception)
142-
== u"Login to CloudShell failed. Please verify the credentials in the config" # noqa: E501
142+
== "Login to CloudShell failed. Please verify the credentials in the config" # noqa: E501
143143
)
144144

145145
@patch("shellfoundry.commands.install_command.ShellPackage")
@@ -165,8 +165,8 @@ def test_install_gen1_shell_non_auth_http_error(self, os_mock, shell_package_moc
165165
# Assert
166166
self.mock_installer.install.assert_called_once()
167167
self.assertTrue(
168-
str(context.exception) == u"Failed to install shell. "
169-
u"CloudShell responded with: 'HTTP Error 404: Non auth error'"
168+
str(context.exception) == "Failed to install shell. "
169+
"CloudShell responded with: 'HTTP Error 404: Non auth error'"
170170
)
171171

172172
@patch("shellfoundry.commands.install_command.ShellPackage")
@@ -192,6 +192,6 @@ def test_install_gen1_shell_base_exception(self, os_mock, shell_package_mock):
192192
# Assert
193193
self.mock_installer.install.assert_called_once()
194194
self.assertTrue(
195-
str(context.exception) == u"Failed to install shell. "
196-
u"CloudShell responded with: 'Some base exception'"
195+
str(context.exception) == "Failed to install shell. "
196+
"CloudShell responded with: 'Some base exception'"
197197
)

tests/test_commands/test_list_command.py

Lines changed: 71 additions & 71 deletions
Large diffs are not rendered by default.

tests/test_commands/test_pack_command.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_build_package_package_created(self, pip_mock, echo_mock):
4646

4747
# Assert
4848
assertFileExists(self, "dist/nut_shell.zip")
49-
echo_mock.assert_any_call(u"Shell package was successfully created:")
49+
echo_mock.assert_any_call("Shell package was successfully created:")
5050

5151
@patch("click.echo")
5252
@patch("shellfoundry.utilities.python_dependencies_packager.pip_main")
@@ -63,7 +63,7 @@ def test_proper_error_message_displayed_when_shell_yml_is_in_wrong_format(
6363
command_executor.pack()
6464

6565
# Assert
66-
echo_mock.assert_any_call(u"shell.yml format is wrong")
66+
echo_mock.assert_any_call("shell.yml format is wrong")
6767

6868
@patch("click.echo")
6969
@patch("shellfoundry.utilities.python_dependencies_packager.pip_main")
@@ -80,7 +80,7 @@ def test_proper_error_message_displayed_when_shell_yml_missing(
8080
command_executor.pack()
8181

8282
# Assert
83-
echo_mock.assert_any_call(u"shell.yml file is missing")
83+
echo_mock.assert_any_call("shell.yml file is missing")
8484

8585
@patch("click.secho")
8686
@patch("shellfoundry.utilities.python_dependencies_packager.pip_main")

tests/test_utilities/test_cloudshell_api/test_client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_client_wrapper_raises_an_error_when_create_client_fails_after_retries_h
6969
# Assert
7070
self.assertEqual(
7171
context.exception.message,
72-
u"Login to CloudShell failed. {}".format(error_msg),
72+
"Login to CloudShell failed. {}".format(error_msg),
7373
)
7474

7575
@patch(

tests/test_utilities/test_driver_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_error_displayed_when_failed_to_connect_to_cloudshell_server(self):
182182
self.assertTrue(echo_mock.called, "click should have been called")
183183
self.assertEqual(
184184
echo_mock.call_args[0][0],
185-
u"Login to CloudShell failed. Please verify the credentials in cloudshell_config.yml", # noqa: E501
185+
"Login to CloudShell failed. Please verify the credentials in cloudshell_config.yml", # noqa: E501
186186
)
187187

188188
# Assert

tests/test_utilities/test_shell_package_installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_fail_to_login_into_cs(self):
149149
# Assert
150150
self.assertTrue(
151151
context.exception.message
152-
== u"Login to CloudShell failed. Please verify the credentials in the config" # noqa: E501
152+
== "Login to CloudShell failed. Please verify the credentials in the config" # noqa: E501
153153
)
154154

155155
@patch(

0 commit comments

Comments
 (0)