mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
run make format
to elasticsearch.tests.*
This commit is contained in:
parent
4b0ca35e2c
commit
53e13559c4
|
@ -28,7 +28,9 @@ def test_filter_string():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesAsField",
|
"articlesAsField",
|
||||||
'headline: "A text"',
|
'headline: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"})])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"})])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +38,9 @@ def test_filter_string_date():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesAsField",
|
"articlesAsField",
|
||||||
'headline: "A text"',
|
'headline: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"})])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"})])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +66,9 @@ def test_filter_in_meta():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMeta",
|
"articlesInMeta",
|
||||||
'headline: "A text"',
|
'headline: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"})])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"})])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,7 +76,9 @@ def test_filter_in_meta_dict():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMetaDict",
|
"articlesInMetaDict",
|
||||||
'headline: "A text"',
|
'headline: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"})])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"})])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +86,9 @@ def test_filter_in_meta_dict_foreign():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMetaDict",
|
"articlesInMetaDict",
|
||||||
'reporterEmail: "A mail"',
|
'reporterEmail: "A mail"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[Match(reporter__email={"query": "A mail", "fuzziness": "auto"})])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[Match(reporter__email={"query": "A mail", "fuzziness": "auto"})])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,16 +96,18 @@ def test_filter_in_multi_field():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMultiField",
|
"articlesInMultiField",
|
||||||
'contain: "A text"',
|
'contain: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(
|
lambda mock: mock.assert_called_with(
|
||||||
must=[
|
Bool(
|
||||||
Bool(
|
must=[
|
||||||
should=[
|
Bool(
|
||||||
Match(headline={"query": "A text", "fuzziness": "auto"}),
|
should=[
|
||||||
Match(lang={"query": "A text", "fuzziness": "auto"}),
|
Match(headline={"query": "A text", "fuzziness": "auto"}),
|
||||||
]
|
Match(lang={"query": "A text", "fuzziness": "auto"}),
|
||||||
)
|
]
|
||||||
]
|
)
|
||||||
)),
|
]
|
||||||
|
)
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,10 +119,15 @@ def compare_must_array(must, other_must):
|
||||||
|
|
||||||
|
|
||||||
def test_filter_generating_all():
|
def test_filter_generating_all():
|
||||||
spected_query = Bool(must=[Match(headline={"query": "A text", "fuzziness": "auto"}),
|
spected_query = Bool(
|
||||||
Match(pub_date={"query": "0000-00-00", "fuzziness": "auto"}),
|
must=[
|
||||||
Match(pub_date_time={"query": "00:00:00", "fuzziness": "auto"}),
|
Match(headline={"query": "A text", "fuzziness": "auto"}),
|
||||||
Match(lang={"query": "es", "fuzziness": "auto"}), Term(importance=1), ])
|
Match(pub_date={"query": "0000-00-00", "fuzziness": "auto"}),
|
||||||
|
Match(pub_date_time={"query": "00:00:00", "fuzziness": "auto"}),
|
||||||
|
Match(lang={"query": "es", "fuzziness": "auto"}),
|
||||||
|
Term(importance=1),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInGenerateAll",
|
"articlesInGenerateAll",
|
||||||
|
|
|
@ -48,7 +48,9 @@ def test_processor_phrase():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMetaDict",
|
"articlesInMetaDict",
|
||||||
'headlinePhrase: "A text"',
|
'headlinePhrase: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[MatchPhrase(headline={"query": "A text"})])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[MatchPhrase(headline={"query": "A text"})])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +58,9 @@ def test_processor_prefix():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMetaDict",
|
"articlesInMetaDict",
|
||||||
'headlinePrefix: "A text"',
|
'headlinePrefix: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[MatchPhrasePrefix(headline={"query": "A text"})])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[MatchPhrasePrefix(headline={"query": "A text"})])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +68,9 @@ def test_processor_in():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMetaDict",
|
"articlesInMetaDict",
|
||||||
'headlineIn: ["A text 1", "A text 2"]',
|
'headlineIn: ["A text 1", "A text 2"]',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[Terms(headline=["A text 1", "A text 2"])])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[Terms(headline=["A text 1", "A text 2"])])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +78,9 @@ def test_processor_exits():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMetaDict",
|
"articlesInMetaDict",
|
||||||
"headlineExits: true",
|
"headlineExits: true",
|
||||||
lambda mock: mock.assert_called_with(Bool(must=[Bool(must=[Exists(field="headline")])])),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=[Bool(must=[Exists(field="headline")])])
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,7 +88,9 @@ def test_processor_lte():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMetaDict",
|
"articlesInMetaDict",
|
||||||
'headlineLte: "A text"',
|
'headlineLte: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=Range(headline={"lte": "A text"}))),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=Range(headline={"lte": "A text"}))
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,5 +98,7 @@ def test_processor_gte():
|
||||||
filter_generation(
|
filter_generation(
|
||||||
"articlesInMetaDict",
|
"articlesInMetaDict",
|
||||||
'headlineGte: "A text"',
|
'headlineGte: "A text"',
|
||||||
lambda mock: mock.assert_called_with(Bool(must=Range(headline={"gte": "A text"}))),
|
lambda mock: mock.assert_called_with(
|
||||||
|
Bool(must=Range(headline={"gte": "A text"}))
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user