Changed the get_mapping test to handle versions correctly

This commit is contained in:
Clinton Gormley 2013-09-18 15:29:40 +02:00
parent 1eed74c9be
commit e957aa3364
1 changed files with 21 additions and 14 deletions

View File

@ -1,5 +1,5 @@
--- ---
"Get index mapping": setup:
- do: - do:
indices.create: indices.create:
index: test_index index: test_index
@ -11,6 +11,8 @@
type: string type: string
analyzer: whitespace analyzer: whitespace
---
"Get index mapping":
- do: - do:
indices.get_mapping: indices.get_mapping:
index: test_index index: test_index
@ -19,26 +21,31 @@
- match: {test_index.test_type.properties.text.analyzer: whitespace} - match: {test_index.test_type.properties.text.analyzer: whitespace}
--- ---
"Get type mapping": "Get type mapping - pre 0.90.2":
- do:
indices.create: - skip:
index: test_index version: "0.90.2 - 999"
body: reason: "for newer versions the index name is always returned"
mappings:
test_type:
properties:
text:
type: string
analyzer: whitespace
- do: - do:
indices.get_mapping: indices.get_mapping:
index: test_index index: test_index
type: test_type type: test_type
- match: {test_index.test_type.properties.text.type: string}
- match: {test_index.test_type.properties.text.analyzer: whitespace}
---
"Get type mapping - post 0.90.2":
- skip: - skip:
version: "0.90.2 - 999" version: "0 - 0.90.1"
reason: "for newer versions the index name is always returned" reason: "for older versions, just the type name is returned"
- do:
indices.get_mapping:
index: test_index
type: test_type
- match: {test_type.properties.text.type: string} - match: {test_type.properties.text.type: string}
- match: {test_type.properties.text.analyzer: whitespace} - match: {test_type.properties.text.analyzer: whitespace}