Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split tests into multiple files for ease of navigation.
Also, add deletion of "another-index" to a tearDown method, because, once one test run fails to delete it, you'd have to delete it manually to get future runs to pass.
- Loading branch information
Showing
5 changed files
with
324 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
Unit tests for pyelasticsearch | ||
These require an elasticsearch server running on the default port | ||
(localhost:9200). | ||
""" | ||
import unittest | ||
|
||
from nose.tools import eq_ | ||
|
||
# Test that __all__ is sufficient: | ||
from pyelasticsearch import * | ||
|
||
|
||
class ElasticSearchTestCase(unittest.TestCase): | ||
def setUp(self): | ||
self.conn = ElasticSearch('http://localhost:9200/') | ||
|
||
def tearDown(self): | ||
try: | ||
self.conn.delete_index('test-index') | ||
except Exception: | ||
pass | ||
|
||
def assert_result_contains(self, result, expected): | ||
for (key, value) in expected.items(): | ||
eq_(value, result[key]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.