aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.py
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2017-04-19 14:39:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-19 19:14:46 +0000
commitffb48e1aaf7f21ad5cc6ee05f5c3ff971a3a967b (patch)
tree9fb385adf1631632d98ef9fa759e69b5b4d851d7 /infra/bots/recipe_modules/builder_name_schema/builder_name_schema.py
parent1e735c0256c5512a48cdd97cbb53141c81ac9539 (diff)
Recipes: remove some pragma: no cover
These are the remaining instances, and they're harder to deal with: $ git grep pragma recipe_modules/swarming/api.py: except self.m.step.StepFailure as e: # pragma: no cover recipe_modules/swarming/api.py: if len(ids) > 1: # pragma: nocover recipes/ct_skps.py: if api.path.exists(version_file): # pragma: nocover recipes/ct_skps.py: if api.path.exists(blacklist_file): # pragma: nocover recipes/upload_nano_results.py: if len(results) != 1: # pragma: nocover Bug: skia:6473 Change-Id: If75e2ffcf39a944b513b9005bbc4bd9c4fb031f6 Reviewed-on: https://skia-review.googlesource.com/13867 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/builder_name_schema/builder_name_schema.py')
-rw-r--r--infra/bots/recipe_modules/builder_name_schema/builder_name_schema.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.py b/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.py
index b004ead532..2c875bacca 100644
--- a/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.py
+++ b/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.py
@@ -47,8 +47,6 @@ def _LoadSchema():
return list(map(_UnicodeToStr, obj))
elif isinstance(obj, tuple):
return tuple(map(_UnicodeToStr, obj))
- else:
- return obj # pragma: no cover
builder_name_json_filename = os.path.join(
os.path.dirname(__file__), 'builder_name_schema.json')
@@ -72,16 +70,16 @@ def _LoadSchema():
_LoadSchema()
-def MakeBuilderName(role, extra_config=None, **kwargs): # pragma: no cover
+def MakeBuilderName(role, extra_config=None, **kwargs):
schema = BUILDER_NAME_SCHEMA.get(role)
- if not schema: # pragma: no cover
+ if not schema:
raise ValueError('%s is not a recognized role.' % role)
for k, v in kwargs.iteritems():
- if BUILDER_NAME_SEP in v: # pragma: no cover
+ if BUILDER_NAME_SEP in v:
raise ValueError('%s not allowed in %s.' % (BUILDER_NAME_SEP, v))
- if not k in schema: # pragma: no cover
+ if not k in schema:
raise ValueError('Schema does not contain "%s": %s' %(k, schema))
- if extra_config and BUILDER_NAME_SEP in extra_config: # pragma: no cover
+ if extra_config and BUILDER_NAME_SEP in extra_config:
raise ValueError('%s not allowed in %s.' % (BUILDER_NAME_SEP,
extra_config))
name_parts = [role]
@@ -98,7 +96,7 @@ def DictForBuilderName(builder_name):
def pop_front():
try:
return split_name.pop(0)
- except: # pragma: no cover
+ except:
raise ValueError('Invalid builder name: %s' % builder_name)
result = {}
@@ -109,9 +107,9 @@ def DictForBuilderName(builder_name):
result[key] = pop_front()
if split_name:
result['extra_config'] = pop_front()
- if split_name: # pragma: no cover
+ if split_name:
raise ValueError('Invalid builder name: %s' % builder_name)
- else: # pragma: no cover
+ else:
raise ValueError('Invalid builder name: %s' % builder_name)
return result