def test_volume_present_with_another_driver(self):
        dockerng_create_volume = Mock(return_value='created')
        dockerng_remove_volume = Mock(return_value='removed')
        __salt__ = {'dockerng.create_volume': dockerng_create_volume,
                    'dockerng.remove_volume': dockerng_remove_volume,
                    'dockerng.volumes': Mock(return_value={
                        'Volumes': [{'Name': 'volume_foo',
                                     'Driver': 'foo'}]}),
                    }
        with patch.dict(dockerng_state.__dict__,
                        {'__salt__': __salt__}):
            ret = dockerng_state.volume_present(
                'volume_foo',
                driver='bar',
                force=True,
                )
        dockerng_remove_volume.assert_called_with('volume_foo')
        dockerng_create_volume.assert_called_with('volume_foo',
                                                  driver='bar',
                                                  driver_opts=None)
        self.assertEqual(ret, {'name': 'volume_foo',
                               'comment': '',
                               'changes': {'created': 'created',
                                           'removed': 'removed'},
                               'result': True})
Subclass should override this function.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/dockerng_test.py/DockerngTestCase.test_volume_present_with_another_driver--crossover with--dataset/ETHPy150Open yuhaozhang/nnjm-global/code/train_util.py/TrainModel.validate