def test_absent(self):
        """
        Test to ensure the named elasticache cluster is deleted.
        """
        name = "new_table"

        ret = {"name": name, "result": True, "changes": {}, "comment": ""}

        mock = MagicMock(side_effect=[False, True])
        with patch.dict(boto_elasticache.__salt__, {"boto_elasticache.exists": mock}):
            comt = "{} does not exist in None.".format(name)
            ret.update({"comment": comt})
            assert boto_elasticache.absent(name) == ret

            with patch.dict(boto_elasticache.__opts__, {"test": True}):
                comt = "Cache cluster {} is set to be removed.".format(name)
                ret.update({"comment": comt, "result": None})
                assert boto_elasticache.absent(name) == ret
Example #2
0
    def test_absent(self):
        '''
        Test to ensure the named elasticache cluster is deleted.
        '''
        name = 'new_table'

        ret = {'name': name, 'result': True, 'changes': {}, 'comment': ''}

        mock = MagicMock(side_effect=[False, True])
        with patch.dict(boto_elasticache.__salt__,
                        {'boto_elasticache.exists': mock}):
            comt = ('{0} does not exist in None.'.format(name))
            ret.update({'comment': comt})
            self.assertDictEqual(boto_elasticache.absent(name), ret)

            with patch.dict(boto_elasticache.__opts__, {'test': True}):
                comt = ('Cache cluster {0} is set to be removed.'.format(name))
                ret.update({'comment': comt, 'result': None})
                self.assertDictEqual(boto_elasticache.absent(name), ret)
Example #3
0
    def test_absent(self):
        '''
        Test to ensure the named elasticache cluster is deleted.
        '''
        name = 'new_table'

        ret = {'name': name,
               'result': True,
               'changes': {},
               'comment': ''}

        mock = MagicMock(side_effect=[False, True])
        with patch.dict(boto_elasticache.__salt__,
                        {'boto_elasticache.exists': mock}):
            comt = ('{0} does not exist in None.'.format(name))
            ret.update({'comment': comt})
            self.assertDictEqual(boto_elasticache.absent(name), ret)

            with patch.dict(boto_elasticache.__opts__, {'test': True}):
                comt = ('Cache cluster {0} is set to be removed.'.format(name))
                ret.update({'comment': comt, 'result': None})
                self.assertDictEqual(boto_elasticache.absent(name), ret)