Skip to content

Commit 5a39e80

Browse files
authored
register IntegrityService correctly (#16543)
Signed-off-by: William Woodruff <[email protected]>
1 parent 5545884 commit 5a39e80

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

tests/unit/attestations/test_init.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
import pretend
14+
15+
from warehouse import attestations
16+
from warehouse.attestations.interfaces import IIntegrityService
17+
from warehouse.attestations.services import IntegrityService
18+
19+
20+
def test_includeme():
21+
config = pretend.stub(
22+
register_service_factory=pretend.call_recorder(
23+
lambda factory, iface, name=None: None
24+
),
25+
)
26+
27+
attestations.includeme(config)
28+
29+
assert config.register_service_factory.calls == [
30+
pretend.call(IntegrityService.create_service, IIntegrityService),
31+
]

warehouse/attestations/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@
2525
"IntegrityService",
2626
"UnsupportedPublisherError",
2727
]
28+
29+
30+
def includeme(config):
31+
config.register_service_factory(IntegrityService.create_service, IIntegrityService)

0 commit comments

Comments
 (0)