def test_get_config_dir_win(self, mock_path_join): mock_path_join.side_effect = lambda x, y: x + y self.assertEquals(_utils.get_config_dir(), 'C:\\gcloud') mock_path_join.side_effect = lambda x, y: x + '\\' + y with mock.patch.dict(os.environ, {'APPDATA': 'test\\path'}): self.assertEquals(_utils.get_config_dir(), 'test\\path\\gcloud')
def test_get_config_dir_win(self, mock_path_join): mock_path_join.side_effect = lambda x, y: x + y self.assertEquals(_utils.get_config_dir(), 'C:\\gcloud') mock_path_join.side_effect = lambda x, y: x + '\\' + y with mock.patch.dict(os.environ, {'APPDATA': 'test\\path'}): self.assertEquals(_utils.get_config_dir(), 'test\\path\\gcloud')
def test_get_config_dir(self, mock_expand_user): mock_expand_user.return_value = 'user/relative/path' with mock.patch.dict(os.environ, {'CLOUDSDK_CONFIG': 'test/path'}): self.assertEquals(_utils.get_config_dir(), 'test/path') self.assertEquals(_utils.get_config_dir(), 'user/relative/path/.config/gcloud')
def test_get_config_dir(self, mock_expand_user): mock_expand_user.return_value = 'user/relative/path' with mock.patch.dict(os.environ, {'CLOUDSDK_CONFIG': 'test/path'}): self.assertEquals(_utils.get_config_dir(), 'test/path') self.assertEquals(_utils.get_config_dir(), 'user/relative/path/.config/gcloud')