Skip to content

Commit

Permalink
adapt to store prefix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiusens committed Mar 14, 2019
1 parent 6881257 commit 1ebf63f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/fake_servers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/store/test_store_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 1ebf63f

Please sign in to comment.