Merge lp:~canonical-platform-qa/snappy-ecosystem-tests/upload-private-snap-logged-out into lp:snappy-ecosystem-tests

Proposed by Omer Akram
Status: Needs review
Proposed branch: lp:~canonical-platform-qa/snappy-ecosystem-tests/upload-private-snap-logged-out
Merge into: lp:snappy-ecosystem-tests
Diff against target: 39 lines (+21/-4)
1 file modified
snappy_ecosystem_tests/tests/test_install_private_snap.py (+21/-4)
To merge this branch: bzr merge lp:~canonical-platform-qa/snappy-ecosystem-tests/upload-private-snap-logged-out
Reviewer Review Type Date Requested Status
platform-qa-bot continuous-integration Approve
Snappy ecosystem tests developer Pending
Review via email: mp+321280@code.launchpad.net

Commit message

Test: try to install a private snap logged-out

Description of the change

Test: try to install a private snap logged-out

To post a comment you must log in.
Revision history for this message
Omer Akram (om26er) wrote :

results incoming, in a bit.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Omer Akram (om26er) wrote :

Unmerged revisions

50. By Omer Akram

try to install a private snap logged-out

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'snappy_ecosystem_tests/tests/test_install_private_snap.py'
--- snappy_ecosystem_tests/tests/test_install_private_snap.py 2017-03-22 12:29:03 +0000
+++ snappy_ecosystem_tests/tests/test_install_private_snap.py 2017-03-29 12:00:54 +0000
@@ -33,10 +33,10 @@
33 super().setUp()33 super().setUp()
34 self.store = Store()34 self.store = Store()
35 self.snapd = Snapd()35 self.snapd = Snapd()
36 email, password = get_store_credentials()36 self.email, password = get_store_credentials()
37 self.assertTrue(self.snapd.login(email, password))37 self.assertTrue(self.snapd.login(self.email, password))
38 self.addCleanup(self.snapd.logout, email)38 self.addCleanup(self.snapd.logout, self.email)
39 self.store.login(email, password)39 self.store.login(self.email, password)
40 self.addCleanup(self.store.logout)40 self.addCleanup(self.store.logout)
41 self.snap_builder = Snapcraft()41 self.snap_builder = Snapcraft()
4242
@@ -58,3 +58,20 @@
58 self.snapd.install(snap_name)58 self.snapd.install(snap_name)
59 self.addCleanup(self.snapd.remove, snap_name)59 self.addCleanup(self.snapd.remove, snap_name)
60 self.assertTrue(self.snapd.is_installed, snap_name)60 self.assertTrue(self.snapd.is_installed, snap_name)
61
62 def test_install_private_snap_logged_out(self):
63 """Test cannot install private snap if not logged in."""
64 snap_name = get_random_snap_name()
65 channels = ['stable']
66 revision = '1'
67 self.assertTrue(self.store.register(snap_name, private=True),
68 'Unable to register snap')
69 # Upload the snap and wait for its processing on server to finish.
70 tracker = self.store.upload(
71 snap_name, self.snap_builder.build_and_pull(snap_name, '0.1'))
72 tracker.track()
73 response = self.store.release(snap_name, revision, channels)
74 self.assertEqual(channels, response.get('opened_channels', None))
75 self.snapd.wait_for_publish(snap_name, revision, channels[0])
76 self.snapd.logout(self.email)
77 self.assertRaises(ValueError, self.snapd.install, snap_name)

Subscribers

People subscribed via source and target branches