diff --git a/dcos_test_utils/package.py b/dcos_test_utils/package.py index 72d6a8b..2c96a30 100644 --- a/dcos_test_utils/package.py +++ b/dcos_test_utils/package.py @@ -117,7 +117,12 @@ def add(self, name: str, uri: str, index: int = None) -> dict: 'uri': uri, 'name': name, } - if index is not None and type(index) == int: + + if index is not None: + idx_type = type(index) + if idx_type != int: + raise TypeError('index of type {} is not supported ' + '- must be int'.format(idx_type)) params['index'] = index self._update_headers('repository.add') @@ -219,12 +224,18 @@ def install(self, name: str, version: str = None, } if version is not None: params['packageVersion'] = version - if options and type(options) == dict: + + if options is not None: + opt_type = type(options) + if opt_type != dict: + raise TypeError('options of type {} is not supported ' + '- must be dict'.format(opt_type)) params['options'] = options + if app_id: params['appId'] = app_id return self._make_request('install', params, - {'response_version': '2', }) + {'response_version': '2'}) def uninstall(self, name: str, app_id: str = None) -> dict: """Uninstall a Universe package