Exemplo n.º 1
0
    def test_decode_PreflightInstanceTask(self):
        obs = etcd.decodeTasks({
            'tasks': [{
                'instance_uuid': 'fake_uuid',
                'network': None,
                'task': 'instance_preflight',
                'version': 1,
            }]
        })

        self.assertItemsEqual(
            {'tasks': [tasks.PreflightInstanceTask('fake_uuid')]}, obs)
Exemplo n.º 2
0
    def test_decode_multi(self):
        obs = etcd.decodeTasks({'tasks': [
            {
                'instance_uuid': 'fake_uuid',
                'network': None,
                'task': 'instance_preflight',
                'version': 1,
            },
            {
                'instance_uuid': 'fake_uuid',
                'task': 'image_fetch',
                'url': 'http://whoknows',
                'version': 1,
            }]})

        self.assertItemsEqual(
            {'tasks': [
                tasks.PreflightInstanceTask('fake_uuid'),
                tasks.FetchImageTask('http://whoknows', 'fake_uuid')
            ]},
            obs)