def test_network_present(self):
        dockerng_create_network = Mock(return_value='created')
        dockerng_connect_container_to_network = Mock(return_value='connected')
        dockerng_inspect_container = Mock(return_value={'Id': 'abcd'})
        __salt__ = {'dockerng.create_network': dockerng_create_network,
                    'dockerng.inspect_container': dockerng_inspect_container,
                    'dockerng.connect_container_to_network': dockerng_connect_container_to_network,
                    'dockerng.networks': Mock(return_value=[]),
                    }
        with patch.dict(dockerng_state.__dict__,
                        {'__salt__': __salt__}):
            ret = dockerng_state.network_present(
                'network_foo',
                containers=['container'],
                )
        dockerng_create_network.assert_called_with('network_foo', driver=None)
        dockerng_connect_container_to_network.assert_called_with('abcd',
                                                                 'network_foo')
        self.assertEqual(ret, {'name': 'network_foo',
                               'comment': '',
                               'changes': {'connected': 'connected',
                                           'created': 'created'},
                               'result': True})
Unpacks a key into a tag and a wire_type according to the protobuf spec.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/dockerng_test.py/DockerngTestCase.test_network_present--crossover with--dataset/ETHPy150Open eigenein/protobuf/protobuf.py/_unpack_key