(self)
| 558 | self.assertEqual(b"foo", content) |
| 559 | |
| 560 | def test_gridfs_secondary(self): |
| 561 | secondary_host, secondary_port = one(self.client.secondaries) |
| 562 | secondary_connection = self.single_client( |
| 563 | secondary_host, secondary_port, read_preference=ReadPreference.SECONDARY |
| 564 | ) |
| 565 | |
| 566 | # Should detect it's connected to secondary and not attempt to |
| 567 | # create index |
| 568 | fs = gridfs.GridFS(secondary_connection.gfsreplica, "gfssecondarytest") |
| 569 | |
| 570 | # This won't detect secondary, raises error |
| 571 | with self.assertRaises(NotPrimaryError): |
| 572 | fs.put(b"foo") |
| 573 | |
| 574 | def test_gridfs_secondary_lazy(self): |
| 575 | # Should detect it's connected to secondary and not attempt to |
nothing calls this directly
no test coverage detected