Skip to content

Commit

Permalink
Merge pull request #849 from untergeek/fix/843
Browse files Browse the repository at this point in the history
Fix test when different IP/port are used
  • Loading branch information
untergeek committed Dec 21, 2016
2 parents e635c5f + 36076eb commit 8511fb6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 6 additions & 1 deletion docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ Changelog
**General**

* Add and increment test versions for Travis CI. #839 (untergeek)


**Bug Fixes**

* Fix cli integration test when different host/port are specified. Reported
in #843 (untergeek)

4.2.4 (7 December 2016)
-----------------------

Expand Down
14 changes: 13 additions & 1 deletion test/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ def test_bad_client_config(self):
)
self.assertEqual(-1, result.exit_code)
def test_no_config(self):
# This test checks whether localhost:9200 is provided if no hosts or
# port are in the configuration. But in testing, sometimes
# TEST_ES_SERVER is set to something other than localhost:9200. In this
# case, the test here would fail. The if statement at the end now
# compensates. See https://github.com/elastic/curator/issues/843
localtest = False
if (host == 'localhost' or host == '127.0.0.1') and \
port == 9200:
localtest = True
self.create_indices(10)
self.write_config(
self.args['configfile'],
Expand All @@ -54,7 +63,10 @@ def test_no_config(self):

],
)
self.assertEqual(0, result.exit_code)
if localtest:
self.assertEqual(0, result.exit_code)
else:
self.assertEqual(-1, result.exit_code)
def test_no_logging_config(self):
self.create_indices(10)
self.write_config(
Expand Down

0 comments on commit 8511fb6

Please sign in to comment.