diff --git a/tests/fake_servers/api.py b/tests/fake_servers/api.py index e33da8ffdc..02fb1b1c5c 100644 --- a/tests/fake_servers/api.py +++ b/tests/fake_servers/api.py @@ -646,7 +646,9 @@ def register_name(self, request): snap_name = request.json_body["snap_name"] store = request.json_body.get("store") - if store == "snapcraft-test" and not snap_name.startswith("snapcraft-test-"): + if store == "snapcraft-test" and not snap_name.startswith( + "test-snapcraft-in-store" + ): return self._register_name_409_error("reserved_name") elif snap_name == "test-snap-name-already-registered": return self._register_name_409_error("already_registered") diff --git a/tests/integration/store/test_store_register.py b/tests/integration/store/test_store_register.py index 7072613bd5..c43aa16783 100644 --- a/tests/integration/store/test_store_register.py +++ b/tests/integration/store/test_store_register.py @@ -34,7 +34,7 @@ def test_successful_private_registration(self): def test_successful_registration_with_store(self): self.login() - snap_name = self.get_unique_name(name_prefix="snapcraft-test") + snap_name = self.get_unique_name(name_prefix="test-snapcraft-in-store") self.register(snap_name, store="snapcraft-test") def test_failed_registration_already_registered(self): @@ -97,7 +97,7 @@ def test_registration_of_reserved_name(self): def test_registration_of_reserved_name_with_store(self): self.login() - snap_name = self.get_unique_name(name_prefix="not-snapcraft-test") + snap_name = self.get_unique_name(name_prefix="not-test-snapcraft-in-store") # The snap name is already registered. error = self.assertRaises( integration.RegisterError, self.register, snap_name, store="snapcraft-test"