tests for get_mapping

This commit is contained in:
Honza Kral 2013-07-15 14:53:32 +02:00
parent 84289de744
commit 59af51838a
3 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,28 @@
---
"Get mapping tests":
- do:
indices.create:
index: test_index
body:
mappings:
test_type:
properties:
text:
type: string
analyzer: whitespace
- do:
indices.get_mapping:
index: test_index
type: test_type
- match: {test_type.properties.text.type: string}
- match: {test_type.properties.text.analyzer: whitespace}
- do:
indices.get_mapping:
index: test_index
- match: {test_index.test_type.properties.text.type: string}
- match: {test_index.test_type.properties.text.analyzer: whitespace}

View File

@ -0,0 +1,19 @@
---
"Raise 404 when type doesn't exist":
- do:
indices.create:
index: test_index
body:
mappings:
test_type:
properties:
text:
type: string
analyzer: whitespace
- do:
catch: missing
indices.get_mapping:
index: test_index
type: not_test_type

View File

@ -0,0 +1,9 @@
---
"Raise 404 when index doesn't exist":
- do:
catch: missing
indices.get_mapping:
index: test_index
type: not_test_type