Ejemplo n.º 1
0
    def setup_method(self, method):
        super().setup_method(method)

        self.sample_message = api.Message(
            topic='',
            body={
                'build_id': 442562,
                'name': 'bodhi',
                'tag_id': 214,
                'instance': 's390',
                'tag': 'f26-updates-testing-pending',
                'user': '******',
                'version': '2.0',
                'owner': 'sharkcz',
                'release': '1.fc17'
            },
        )
        self.sample_side_tag_message = api.Message(
            topic='',
            body={
                'build_id': 442562,
                'name': 'bodhi',
                'tag_id': 214,
                'instance': 's390',
                'tag': 'f30-side-tag-testing-pending',
                'user': '******',
                'version': '2.0',
                'owner': 'sharkcz',
                'release': '1.fc17'
            },
        )
        self.handler = signed.SignedHandler()
Ejemplo n.º 2
0
 def setUp(self):
     self.sample_message = Message(
         topic='',
         body={
             'build_id': 442562,
             'name': 'colord',
             'tag_id': 214,
             'instance': 's390',
             'tag': 'f26-updates-testing-pending',
             'user': '******',
             'version': '1.3.4',
             'owner': 'sharkcz',
             'release': '1.fc26'
         },
     )
     self.sample_side_tag_message = Message(
         topic='',
         body={
             'build_id': 442562,
             'name': 'colord',
             'tag_id': 214,
             'instance': 's390',
             'tag': 'f30-side-tag-testing',
             'user': '******',
             'version': '1.3.4',
             'owner': 'sharkcz',
             'release': '1.fc26'
         },
     )
     self.handler = signed.SignedHandler()
Ejemplo n.º 3
0
 def setUp(self):
     self.sample_message = {
         'body': {
             'i': 628,
             'timestamp': 1484692585,
             'msg_id': '2017-821031da-be3a-4f4b-91df-0baa834ca8a4',
             'crypto': 'x509',
             'topic': 'org.fedoraproject.prod.buildsys.tag',
             'signature': '100% real please trust me',
             'msg': {
                 'build_id': 442562,
                 'name': 'colord',
                 'tag_id': 214,
                 'instance': 's390',
                 'tag': 'f26-updates-testing-pending',
                 'user': '******',
                 'version': '1.3.4',
                 'owner': 'sharkcz',
                 'release': '1.fc26'
             },
         },
     }
     hub = mock.MagicMock()
     hub.config = {
         'environment': 'environment',
         'topic_prefix': 'topic_prefix'
     }
     self.handler = signed.SignedHandler(hub)
Ejemplo n.º 4
0
    def test___init__(self):
        """Test __init__() with a manufactured hub config."""
        hub = mock.MagicMock()
        hub.config = {
            'environment': 'environment',
            'topic_prefix': 'topic_prefix'
        }

        handler = signed.SignedHandler(hub)

        self.assertEqual(handler.topic,
                         ['topic_prefix.environment.buildsys.tag'])
Ejemplo n.º 5
0
    def test_calls_super(self, __init__):
        """Assert that __init__() calls the superclass __init__()."""
        hub = mock.MagicMock()
        hub.config = {
            'environment': 'environment',
            'topic_prefix': 'topic_prefix'
        }

        handler = signed.SignedHandler(hub)

        self.assertEqual(handler.topic,
                         ['topic_prefix.environment.buildsys.tag'])
        __init__.assert_called_once_with(hub)