@@ -46,6 +46,9 @@ def test_destroy_document_type(self):
46
46
def test_documents (self ):
47
47
self .__is_expected_collection (self .client .documents , 200 , 2 , {'external_id' : '1' }, self .engine , self .document_type )
48
48
49
+ def test_documents_pagination (self ):
50
+ self .__is_expected_collection (self .client .documents , 200 , 2 , {'external_id' : '1' }, self .engine , self .document_type , 2 , 10 )
51
+
49
52
def test_document (self ):
50
53
external_id = '1'
51
54
id = self .client .document (self .engine , self .document_type , external_id )['body' ]['external_id' ]
@@ -95,29 +98,61 @@ def test_search(self):
95
98
self .assertTrue (total_count > 1 )
96
99
self .__is_expected_search_result (self .client .search , total_count )
97
100
101
+ def test_search_with_options (self ):
102
+ total_count = len (self .client .document_types (self .engine )['body' ])
103
+ self .assertTrue (total_count > 1 )
104
+ response = self .client .search (self .engine , 'query' , {'page' : 2 })
105
+ self .assertEqual (len (response ['body' ]['records' ]), total_count )
106
+
98
107
def test_search_document_type (self ):
99
108
self .__is_expected_search_result (self .client .search_document_type , 1 , [self .document_type ])
100
109
110
+ def test_search_document_type (self ):
111
+ response = self .client .search_document_type (self .engine , self .document_type , "query" , {'page' : 2 })
112
+ self .assertEqual (len (response ['body' ]['records' ]), 1 )
113
+
101
114
def test_suggest (self ):
102
115
total_count = len (self .client .document_types (self .engine )['body' ])
103
116
self .assertTrue (total_count > 1 )
104
117
self .__is_expected_search_result (self .client .suggest , total_count )
105
118
119
+ def test_suggest_with_options (self ):
120
+ total_count = len (self .client .document_types (self .engine )['body' ])
121
+ self .assertTrue (total_count > 1 )
122
+ response = self .client .suggest (self .engine , 'query' , {'page' : 2 })
123
+ self .assertEqual (len (response ['body' ]['records' ]), total_count )
124
+
106
125
def test_suggest_document_type (self ):
107
126
self .__is_expected_search_result (self .client .suggest_document_type , 1 , [self .document_type ])
108
127
128
+ def test_suggest_document_type_with_options (self ):
129
+ response = self .client .suggest_document_type (self .engine , self .document_type , "query" , {'page' : 2 })
130
+ self .assertEqual (len (response ['body' ]['records' ]), 1 )
131
+
109
132
def test_analytics_searches (self ):
110
133
searches = self .client .analytics_searches (self .engine )['body' ]
111
134
self .assertTrue (len (searches ) == 1 )
112
135
136
+ def test_analytics_searches_pagination (self ):
137
+ searches = self .client .analytics_searches (self .engine , '2013-01-01' , '2013-02-01' )['body' ]
138
+ self .assertTrue (len (searches ) == 0 )
139
+
113
140
def test_analytics_autoselects (self ):
114
141
autoselects = self .client .analytics_autoselects (self .engine )['body' ]
115
142
self .assertTrue (len (autoselects ) == 1 )
116
143
144
+ def test_analytics_autoselects_pagination (self ):
145
+ autoselects = self .client .analytics_autoselects (self .engine , '2013-01-01' , '2013-02-01' )['body' ]
146
+ self .assertTrue (len (autoselects ) == 0 )
147
+
117
148
def test_analytics_top_queries (self ):
118
149
top_queries = self .client .analytics_top_queries (self .engine )['body' ]
119
150
self .assertTrue (len (top_queries ) == 2 )
120
151
152
+ def test_analytics_top_queries (self ):
153
+ top_queries = self .client .analytics_top_queries (self .engine , '2013-01-01' , '2013-02-01' )['body' ]
154
+ self .assertTrue (len (top_queries ) == 0 )
155
+
121
156
def test_domains (self ):
122
157
domains = self .client .domains (self .engine )['body' ]
123
158
self .assertTrue (len (domains ) == 2 )
0 commit comments