Beispiel #1
0
 def test_absent(self):
     '''
     Test docker_volume.absent
     '''
     docker_remove_volume = Mock(return_value='removed')
     __salt__ = {
         'docker.remove_volume':
         docker_remove_volume,
         'docker.volumes':
         Mock(return_value={'Volumes': [{
             'Name': 'volume_foo'
         }]}),
     }
     with patch.dict(docker_state.__dict__, {'__salt__': __salt__}):
         ret = docker_state.absent('volume_foo', )
     docker_remove_volume.assert_called_with('volume_foo')
     self.assertEqual(
         ret, {
             'name': 'volume_foo',
             'comment': '',
             'changes': {
                 'removed': 'removed'
             },
             'result': True
         })
Beispiel #2
0
 def test_absent(self):
     """
     Test docker_volume.absent
     """
     docker_remove_volume = Mock(return_value="removed")
     __salt__ = {
         "docker.remove_volume":
         docker_remove_volume,
         "docker.volumes":
         Mock(return_value={"Volumes": [{
             "Name": "volume_foo"
         }]}),
     }
     with patch.dict(docker_state.__dict__, {"__salt__": __salt__}):
         ret = docker_state.absent("volume_foo", )
     docker_remove_volume.assert_called_with("volume_foo")
     self.assertEqual(
         ret,
         {
             "name": "volume_foo",
             "comment": "",
             "changes": {
                 "removed": "removed"
             },
             "result": True,
         },
     )