Closed lukas-vlcek closed 7 years ago
@richm PTAL
@richm I did some modifications. The option is called --transform=nested
now and the code is more general & prepared to support more transformation types in the future.
Add a test like this e.g. to tests/commands/test_cluster_state.py:
def test_bogus_transform_value(self):
cmd = self.appendSecurityCommands(['watches', 'cluster_state', '--transform=bogus'])
output, errout = popen(cmd, stdout=PIPE, stderr=PIPE).communicate()
self.assertRegexpMatches(errout, '(?ms)ERROR:.*RuntimeError: Unsupported transform type')
I think you only need to add a test like this to one of the commands that supports the --transform
argument.
Done (in tests/commands/test_cluster_health.py
).
Most commands accept
--transform=nested
option. It transforms JSON response to nested data (this means the JSON does not contain data as a JSON keys).Make tests pass on clusters with more than one node.
Closes #24