(self, client)
| 1253 | |
| 1254 | @pytest.mark.redismod |
| 1255 | def test_casesensitive(self, client): |
| 1256 | # create index |
| 1257 | SCHEMA = (TagField("t", case_sensitive=False),) |
| 1258 | client.ft().create_index(SCHEMA) |
| 1259 | client.ft().client.hset("1", "t", "HELLO") |
| 1260 | client.ft().client.hset("2", "t", "hello") |
| 1261 | |
| 1262 | res = client.ft().search("@t:{HELLO}") |
| 1263 | |
| 1264 | if expects_resp2_shape(client) or expects_unified_shape(client): |
| 1265 | assert 2 == len(res.docs) |
| 1266 | assert "1" == res.docs[0].id |
| 1267 | assert "2" == res.docs[1].id |
| 1268 | elif expects_resp3_shape(client): |
| 1269 | assert 2 == len(res["results"]) |
| 1270 | assert "1" == res["results"][0]["id"] |
| 1271 | assert "2" == res["results"][1]["id"] |
| 1272 | |
| 1273 | # create casesensitive index |
| 1274 | client.ft().dropindex() |
| 1275 | SCHEMA = (TagField("t", case_sensitive=True),) |
| 1276 | client.ft().create_index(SCHEMA) |
| 1277 | self.waitForIndex(client, getattr(client.ft(), "index_name", "idx")) |
| 1278 | |
| 1279 | res = client.ft().search("@t:{HELLO}") |
| 1280 | if expects_resp2_shape(client) or expects_unified_shape(client): |
| 1281 | assert 1 == len(res.docs) |
| 1282 | assert "1" == res.docs[0].id |
| 1283 | elif expects_resp3_shape(client): |
| 1284 | assert 1 == len(res["results"]) |
| 1285 | assert "1" == res["results"][0]["id"] |
| 1286 | |
| 1287 | @pytest.mark.redismod |
| 1288 | @skip_ifmodversion_lt("2.2.0", "search") |
nothing calls this directly
no test coverage detected