Beispiel #1
0
def test_creategroup():
    """
    Test to ensure the replication group is created.
    """
    name = "new_table"
    primary_cluster_id = "A"
    replication_group_description = "my description"

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

    mock = MagicMock(return_value=True)
    with patch.dict(boto_elasticache.__salt__,
                    {"boto_elasticache.group_exists": mock}):
        comt = "{} replication group exists .".format(name)
        ret.update({"comment": comt})
        assert (boto_elasticache.creategroup(
            name, primary_cluster_id, replication_group_description) == ret)
Beispiel #2
0
    def test_creategroup(self):
        '''
        Test to ensure the a replication group is create.
        '''
        name = 'new_table'
        primary_cluster_id = 'A'
        replication_group_description = 'my description'

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

        mock = MagicMock(return_value=True)
        with patch.dict(boto_elasticache.__salt__,
                        {'boto_elasticache.group_exists': mock}):
            comt = ('{0} replication group exists .'.format(name))
            ret.update({'comment': comt})
            self.assertDictEqual(
                boto_elasticache.creategroup(name, primary_cluster_id,
                                             replication_group_description),
                ret)
Beispiel #3
0
    def test_creategroup(self):
        '''
        Test to ensure the a replication group is create.
        '''
        name = 'new_table'
        primary_cluster_id = 'A'
        replication_group_description = 'my description'

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

        mock = MagicMock(return_value=True)
        with patch.dict(boto_elasticache.__salt__,
                        {'boto_elasticache.group_exists': mock}):
            comt = ('{0} replication group exists .'.format(name))
            ret.update({'comment': comt})
            self.assertDictEqual(boto_elasticache.creategroup
                                 (name, primary_cluster_id,
                                  replication_group_description), ret)