Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate gen test samples. #111

Merged
merged 1 commit into from
Jun 1, 2016
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
31 changes: 0 additions & 31 deletions apitools/gen/gen_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,6 @@ def testHelp_NotEnoughArguments(self):
self.assertIn('usage:', err_output)
self.assertIn('error: too few arguments', err_output)

def _CheckGeneratedFiles(self, api_name, api_version):
prefix = api_name + '_' + api_version
with test_utils.TempDir() as tmp_dir_path:
gen_client.main([
gen_client.__file__,
'--generate_cli',
'--init-file', 'empty',
'--infile',
GetTestDataPath(api_name, prefix + '.json'),
'--outdir', tmp_dir_path,
'--overwrite',
'--root_package', api_name,
'client'
])
expected_files = (
set([prefix + '.py']) | # CLI files
set([prefix + '_client.py',
prefix + '_messages.py',
'__init__.py']))
self.assertEquals(expected_files, set(os.listdir(tmp_dir_path)))
for expected_file in expected_files:
self.assertMultiLineEqual(
_GetContent(GetTestDataPath(api_name, expected_file)),
_GetContent(os.path.join(tmp_dir_path, expected_file)))

def testGenClient_DnsDoc(self):
self._CheckGeneratedFiles('dns', 'v1')

def testGenClient_IamDoc(self):
self._CheckGeneratedFiles('iam', 'v1')

def testGenClient_SimpleDocNoInit(self):
with test_utils.TempDir() as tmp_dir_path:
gen_client.main([
Expand Down
4 changes: 3 additions & 1 deletion run_pylint.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@

IGNORED_DIRECTORIES = [
'apitools/gen/testdata',
'samples/storage_sample/storage',
'samples/dns_sample/dns_v1',
'samples/iam_sample/iam_v1',
'samples/storage_sample/storage_v1',
'venv',
]
IGNORED_FILES = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#
# Copyright 2015 Google Inc.
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,15 +11,3 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Common imports for generated storage client library."""
# pylint:disable=wildcard-import

import pkgutil

from apitools.base.py import *
from storage_v1 import *
from storage_v1_client import *
from storage_v1_messages import *

__path__ = pkgutil.extend_path(__path__, __name__)
Loading