Skip to content

Commit feec39b

Browse files
authored
A few clean-ups (GoogleCloudPlatform#261)
1 parent 7ab0f4c commit feec39b

6 files changed

Lines changed: 8 additions & 5 deletions

File tree

cloud_sql_proxy

7.59 MB
Binary file not shown.

compatibility_lib/compatibility_lib/compatibility_store.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def __init__(self,
130130
mysql_user=None,
131131
mysql_password=None,
132132
mysql_host=None,
133+
mysql_port=3306,
133134
mysql_unix_socket=None,
134135
mysql_db=None):
135136
if mysql_user is None:
@@ -146,6 +147,7 @@ def __init__(self,
146147
self.mysql_user = mysql_user
147148
self.mysql_password = mysql_password
148149
self.mysql_host = mysql_host
150+
self.mysql_port = mysql_port
149151
self.mysql_unix_socket = mysql_unix_socket
150152
self.mysql_db = mysql_db
151153

@@ -163,6 +165,7 @@ def connect(self):
163165
else:
164166
conn = pymysql.connect(
165167
host=self.mysql_host,
168+
port=self.mysql_port,
166169
user=self.mysql_user,
167170
password=self.mysql_password,
168171
db=_DATABASE_NAME,

compatibility_lib/compatibility_lib/test_dependency_highlighter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def setUp(self):
135135

136136
fake_value = [[{'dependency_info': _get_dep_info(False)}]]
137137
self._checker = mock.Mock()
138-
self._checker.get_self_compatibility.return_value = fake_value
138+
self._checker.get_compatibility.return_value = fake_value
139139

140140
def setup_test__get_update_priority(self):
141141
low = dependency_highlighter.PriorityLevel.LOW_PRIORITY

compatibility_lib/compatibility_lib/test_deprecated_dep_finder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def setUp(self):
6969
self.mock_checker = mock.Mock(autospec=True)
7070
self.fake_store = fake_compatibility_store.CompatibilityStore()
7171

72-
self.mock_checker.get_self_compatibility.return_value = \
72+
self.mock_checker.get_compatibility.return_value = \
7373
self.SELF_COMP_RES
7474

7575
def test_constructor_default(self):

compatibility_lib/compatibility_lib/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def check(self, packages, python_version):
5757
'dependency_info': DEP_INFO,
5858
}
5959

60-
def get_self_compatibility(self, python_version, packages=None):
60+
def get_compatibility(self, python_version, packages=None):
6161
return [[self.check(
6262
packages=packages, python_version=python_version)]]
6363

compatibility_lib/compatibility_lib/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def _get_from_endpoint(self, package_name):
111111
a dict mapping from dependency package name (string) to
112112
the info (dict)
113113
"""
114-
_result = self.checker.get_self_compatibility(
115-
self.py_version, [package_name])
114+
_result = self.checker.get_compatibility(
115+
python_version=self.py_version, packages=[package_name])
116116
result = [item for item in _result]
117117
depinfo = result[0][0].get('dependency_info')
118118

0 commit comments

Comments
 (0)