Run a test only if the client is connected to a replica set that has `count` secondaries.
(self, count)
| 557 | return self._require(lambda: self.is_rs, "Not connected to a replica set", func=func) |
| 558 | |
| 559 | def require_secondaries_count(self, count): |
| 560 | """Run a test only if the client is connected to a replica set that has |
| 561 | `count` secondaries. |
| 562 | """ |
| 563 | |
| 564 | def sec_count(): |
| 565 | return 0 if not self.client else len(self.client.secondaries) |
| 566 | |
| 567 | def check(): |
| 568 | return sec_count() >= count |
| 569 | |
| 570 | return self._require(check, "Not enough secondaries available") |
| 571 | |
| 572 | @property |
| 573 | def supports_secondary_read_pref(self): |