Beispiel #1
0
    def test_collaborate_snap_developer_not_found(self):
        self.client.login('dummy', 'test correct password')

        _store.collaborate('core-no-dev', 'keyname')

        self.assertNotIn('Error signing developers assertion',
                         self.fake_logger.output)
        self.assertNotIn('Invalid response from the server',
                         self.fake_logger.output)
Beispiel #2
0
    def test_collaborate_unchanged_collaborators(self):
        self.edit_collaborators_mock.return_value = [{
            'developer-id': 'test-dev-id',
            'since': '2017-02-10T08:35:00.000000Z',
            'until': '2018-02-10T08:35:00.000000Z'
        }]
        self.client.login('dummy', 'test correct password')
        _store.collaborate('test-snap-with-dev', 'keyname')

        self.assertIn('Aborting due to unchanged collaborators list.',
                      self.fake_logger.output)
    def test_collaborate_unchanged_collaborators(self):
        self.edit_collaborators_mock.return_value = [{
            'developer-id': 'test-dev-id',
            'since': '2017-02-10T08:35:00.000000Z',
            'until': '2018-02-10T08:35:00.000000Z'
        }]
        self.client.login('dummy', 'test correct password')
        _store.collaborate('test-snap-with-dev', 'keyname')

        self.assertIn('Aborting due to unchanged collaborators list.',
                      self.fake_logger.output)
Beispiel #4
0
    def test_collaborate_success(self):
        self.client.login('dummy', 'test correct password')
        collaborate('ubuntu-core', 'keyname')

        self.popen_mock.assert_called_with(['snap', 'sign', '-k', 'keyname'],
                                           stderr=-1,
                                           stdin=-1,
                                           stdout=-1)
        self.assertIn('Signing developers assertion for ubuntu-core',
                      self.fake_logger.output)
        self.assertNotIn('Error signing developers assertion',
                         self.fake_logger.output)
        self.assertNotIn('Invalid response from the server',
                         self.fake_logger.output)
Beispiel #5
0
    def test_collaborate_success(self):
        self.edit_collaborators_mock.return_value = {
            'developers': [{
                'developer-id': 'dummy-id',
                'since': '2015-07-19 19:30:00'}]
        }
        self.client.login('dummy', 'test correct password')
        _store.collaborate('ubuntu-core', 'keyname')

        self.popen_mock.assert_called_with(['snap', 'sign', '-k', 'keyname'],
                                           stderr=-1, stdin=-1, stdout=-1)
        self.assertNotIn('Error signing developers assertion',
                         self.fake_logger.output)
        self.assertNotIn('Invalid response from the server',
                         self.fake_logger.output)