Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,10 @@ def test_k8s_install_kubelogin_emit_warnings(self, logger_mock, mock_url_retriev
try:
temp_dir = os.path.realpath(tempfile.mkdtemp()) # tempfile.TemporaryDirectory() is no available on 2.7
test_location = os.path.join(temp_dir, 'kubelogin')
k8s_install_kubelogin(mock.MagicMock(), client_version='0.0.4', install_location=test_location)
k8s_install_kubelogin(mock.MagicMock(), client_version='0.0.4', install_location=test_location, arch="amd64")
self.assertEqual(mock_url_retrieve.call_count, 1)
# 3 warnings, 1st for arch, 2nd for download result, 3rd for updating PATH
self.assertEqual(logger_mock.warning.call_count, 3) # 3 warnings, one for download result
# 2 warnings, 1st for download result, 2nd for updating PATH
self.assertEqual(logger_mock.warning.call_count, 2) # 3 warnings, one for download result
finally:
shutil.rmtree(temp_dir)

Expand All @@ -659,7 +659,7 @@ def test_k8s_install_kubelogin_create_installation_dir(self, logger_mock, mock_u
try:
temp_dir = tempfile.mkdtemp() # tempfile.TemporaryDirectory() is no available on 2.7
test_location = os.path.join(temp_dir, 'foo', 'kubelogin')
k8s_install_kubelogin(mock.MagicMock(), client_version='0.0.4', install_location=test_location)
k8s_install_kubelogin(mock.MagicMock(), client_version='0.0.4', install_location=test_location, arch="amd64")
self.assertTrue(os.path.exists(test_location))
finally:
shutil.rmtree(temp_dir)
Expand Down Expand Up @@ -688,7 +688,7 @@ def test_k8s_install_kubelogin_with_custom_source_url(self, logger_mock, mock_ur
test_location = os.path.join(temp_dir, 'foo', 'kubelogin')
test_ver = '1.2.6'
test_source_url = 'http://url2'
k8s_install_kubelogin(mock.MagicMock(), client_version=test_ver, install_location=test_location, source_url=test_source_url)
k8s_install_kubelogin(mock.MagicMock(), client_version=test_ver, install_location=test_location, source_url=test_source_url, arch="amd64")
mock_url_retrieve.assert_called_with(mockUrlretrieveUrlValidator(test_source_url, test_ver), mock.ANY)
finally:
shutil.rmtree(temp_dir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,10 @@ def test_k8s_install_kubelogin_emit_warnings(self, logger_mock, mock_url_retriev
try:
temp_dir = os.path.realpath(tempfile.mkdtemp()) # tempfile.TemporaryDirectory() is no available on 2.7
test_location = os.path.join(temp_dir, 'kubelogin')
k8s_install_kubelogin(mock.MagicMock(), client_version='0.0.4', install_location=test_location)
k8s_install_kubelogin(mock.MagicMock(), client_version='0.0.4', install_location=test_location, arch="amd64")
self.assertEqual(mock_url_retrieve.call_count, 1)
# 3 warnings, 1st for arch, 2nd for download result, 3rd for updating PATH
self.assertEqual(logger_mock.warning.call_count, 3) # 3 warnings, one for download result
# 2 warnings, 1st for download result, 2nd for updating PATH
self.assertEqual(logger_mock.warning.call_count, 2) # 2 warnings, one for download result
finally:
shutil.rmtree(temp_dir)

Expand All @@ -643,7 +643,7 @@ def test_k8s_install_kubelogin_create_installation_dir(self, logger_mock, mock_u
try:
temp_dir = tempfile.mkdtemp() # tempfile.TemporaryDirectory() is no available on 2.7
test_location = os.path.join(temp_dir, 'foo', 'kubelogin')
k8s_install_kubelogin(mock.MagicMock(), client_version='0.0.4', install_location=test_location)
k8s_install_kubelogin(mock.MagicMock(), client_version='0.0.4', install_location=test_location, arch="amd64")
self.assertTrue(os.path.exists(test_location))
finally:
shutil.rmtree(temp_dir)
Expand Down Expand Up @@ -672,7 +672,7 @@ def test_k8s_install_kubelogin_with_custom_source_url(self, logger_mock, mock_ur
test_location = os.path.join(temp_dir, 'foo', 'kubelogin')
test_ver = '1.2.6'
test_source_url = 'http://url2'
k8s_install_kubelogin(mock.MagicMock(), client_version=test_ver, install_location=test_location, source_url=test_source_url)
k8s_install_kubelogin(mock.MagicMock(), client_version=test_ver, install_location=test_location, source_url=test_source_url, arch="amd64")
mock_url_retrieve.assert_called_with(MockUrlretrieveUrlValidator(test_source_url, test_ver), mock.ANY)
finally:
shutil.rmtree(temp_dir)
Expand Down