diff --git a/bindings/python/src/capability.rs b/bindings/python/src/capability.rs index f1b1b351e1b9..41fc17dd43cf 100644 --- a/bindings/python/src/capability.rs +++ b/bindings/python/src/capability.rs @@ -34,6 +34,10 @@ pub struct Capability { pub stat_with_if_match: bool, /// If operator supports stat with if none match. pub stat_with_if_none_match: bool, + /// If operator supports stat with if modified since. + pub stat_with_if_modified_since: bool, + /// If operator supports stat with if unmodified since. + pub stat_with_if_unmodified_since: bool, /// If operator supports stat with version. pub stat_with_version: bool, @@ -139,6 +143,8 @@ impl Capability { stat: capability.stat, stat_with_if_match: capability.stat_with_if_match, stat_with_if_none_match: capability.stat_with_if_none_match, + stat_with_if_modified_since: capability.stat_with_if_modified_since, + stat_with_if_unmodified_since: capability.stat_with_if_unmodified_since, stat_with_version: capability.stat_with_version, read: capability.read, read_with_if_match: capability.read_with_if_match, diff --git a/bindings/python/tests/test_stat_capability.py b/bindings/python/tests/test_stat_capability.py new file mode 100644 index 000000000000..0f13df2f4994 --- /dev/null +++ b/bindings/python/tests/test_stat_capability.py @@ -0,0 +1,27 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import opendal + + +def test_stat_capability_fields_exist(): + op = opendal.Operator("memory") + cap = op.capability() + + assert isinstance(cap.stat_with_if_modified_since, bool) + assert isinstance(cap.stat_with_if_unmodified_since, bool) + assert isinstance(cap.stat_with_version, bool)