def test_get_cursor(self): self.assertIsNone(get_cursor(get_cluster_initialized_without_leader(), {}, role='master')) self.assertIsNotNone(get_cursor(get_cluster_initialized_with_leader(), {}, role='master')) # MockCursor returns pg_is_in_recovery as false self.assertIsNone(get_cursor(get_cluster_initialized_with_leader(), {}, role='replica')) self.assertIsNotNone(get_cursor(get_cluster_initialized_with_leader(), {'database': 'foo'}, role='any'))
def test_get_cursor(self): self.assertIsNone(get_cursor(get_cluster_initialized_without_leader(), role='master')) self.assertIsNotNone(get_cursor(get_cluster_initialized_with_leader(), role='master')) # MockCursor returns pg_is_in_recovery as false self.assertIsNone(get_cursor(get_cluster_initialized_with_leader(), role='replica')) self.assertIsNotNone(get_cursor(get_cluster_initialized_with_leader(), role='any'))
def test_get_cursor(self): c = get_cursor(get_cluster_initialized_without_leader(), role='master') assert c is None c = get_cursor(get_cluster_initialized_with_leader(), role='master') assert c is not None c = get_cursor(get_cluster_initialized_with_leader(), role='replica') # # MockCursor returns pg_is_in_recovery as false assert c is None c = get_cursor(get_cluster_initialized_with_leader(), role='any') assert c is not None
def test_get_cursor(self): c = get_cursor(get_cluster_initialized_without_leader(), role="master") assert c is None c = get_cursor(get_cluster_initialized_with_leader(), role="master") assert c is not None c = get_cursor(get_cluster_initialized_with_leader(), role="replica") # # MockCursor returns pg_is_in_recovery as false assert c is None c = get_cursor(get_cluster_initialized_with_leader(), role="any") assert c is not None