Barry Warsaw pushed to branch coverage at mailman / Mailman Core
Commits:
8fbcf37a by Barry Warsaw at 2017-07-24T19:54:48-04:00
Boost coverage.
- - - - -
2 changed files:
- src/mailman/rest/listconf.py
- src/mailman/rest/preferences.py
Changes:
=====================================
src/mailman/rest/listconf.py
=====================================
--- a/src/mailman/rest/listconf.py
+++ b/src/mailman/rest/listconf.py
@@ -97,7 +97,7 @@ def pipeline_validator(pipeline_name):
def password_bytes_validator(value):
- if value is None or isinstance(value, bytes):
+ if value is None or isinstance(value, bytes): # pragma: nobranch
return value
return config.password_context.encrypt(value).encode('utf-8')
@@ -196,7 +196,7 @@ def api_attributes(api):
# attributes, although we map them to templates. In API 3.1 and beyond,
# only the template manager API can be used for these.
attributes = ATTRIBUTES.copy()
- if api.version_info == (3, 0):
+ if api.version_info == (3, 0): # pragma: nobranch
attributes.update({
attribute: URIAttributeMapper(str)
for attribute in TEMPLATE_ATTRIBUTES
@@ -243,7 +243,7 @@ class ListConfiguration:
# handled by the template manager API.
validators = VALIDATORS.copy()
attributes = api_attributes(self.api)
- if self.api.version_info == (3, 0):
+ if self.api.version_info == (3, 0): # pragma: nobranch
validators.update({
attribute: URIAttributeMapper(str)
for attribute in TEMPLATE_ATTRIBUTES
=====================================
src/mailman/rest/preferences.py
=====================================
--- a/src/mailman/rest/preferences.py
+++ b/src/mailman/rest/preferences.py
@@ -69,9 +69,7 @@ class Preferences(ReadOnlyPreferences):
"""Preferences which can be changed."""
def _patch_put(self, request, response, is_optional):
- if self._parent is None:
- not_found(response)
- return
+ assert self._parent is not None
kws = dict(
acknowledge_posts=GetterSetter(as_boolean),
hide_address=GetterSetter(as_boolean),
View it on GitLab:
https://gitlab.com/mailman/mailman/commit/8fbcf37a3d9837799f3bb18e5e4395caf60bf44f
---
View it on GitLab:
https://gitlab.com/mailman/mailman/commit/8fbcf37a3d9837799f3bb18e5e4395caf60bf44f
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org