Ejemplo n.º 1
0
def _reject_swarming_bucket(bucket_id):
    config.validate_bucket_id(bucket_id)
    _, cfg = config.get_bucket(bucket_id)
    assert cfg, 'permission check should have failed'
    if config.is_swarming_config(cfg):
        raise errors.InvalidInputError(
            'Invalid operation on a Swarming bucket')
Ejemplo n.º 2
0
    def test_is_swarming_config(self):
        cfg = project_config_pb2.Bucket()
        self.assertFalse(config.is_swarming_config(cfg))

        cfg.swarming.hostname = 'exists.now'
        self.assertTrue(config.is_swarming_config(cfg))