When describing a package print the full response (#1005)

* When describing a package print the full response
* Update expected result
* Update marathon describe response
* Change test describe
This commit is contained in:
José Armando García Sancio
2017-07-14 14:35:54 -07:00
committed by Kevin Klues
parent 2f5a3a125c
commit bdda6756ce
4 changed files with 1003 additions and 992 deletions

View File

@@ -275,8 +275,6 @@ def _describe(package_name,
package_manager = get_package_manager() package_manager = get_package_manager()
pkg = package_manager.get_package_version(package_name, package_version) pkg = package_manager.get_package_version(package_name, package_version)
pkg_json = pkg.package_json()
if package_versions: if package_versions:
emitter.publish(pkg.package_versions()) emitter.publish(pkg.package_versions())
elif cli or app or config: elif cli or app or config:
@@ -294,7 +292,7 @@ def _describe(package_name,
config_output = pkg.config_json() config_output = pkg.config_json()
emitter.publish(config_output) emitter.publish(config_output)
else: else:
emitter.publish(pkg_json) emitter.publish(pkg.package_response())
return 0 return 0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -379,7 +379,7 @@ class CosmosPackageVersion():
return self._package_json["package"]["name"] return self._package_json["package"]["name"]
def package_json(self): def package_json(self):
"""Returns the JSON content of the package.json file. """Returns the JSON content of the package definition.
:returns: Package data :returns: Package data
:rtype: dict :rtype: dict
@@ -387,6 +387,15 @@ class CosmosPackageVersion():
return self._package_json["package"] return self._package_json["package"]
def package_response(self):
"""Returns the JSON content of the describe response.
:returns: Package data
:rtype: dict
"""
return self._package_json
def config_json(self): def config_json(self):
"""Returns the JSON content of the config.json file. """Returns the JSON content of the config.json file.