def test_replace(self):
        class MockMemcache(object):
            """
            Mock of memcache
            """
            def __init__(self):
                self.key = None
                self.value = None
                self.time = None
                self.min_compress_len = None

            @staticmethod
            def get_stats():
                """
                Mock of stats method
                """
                return [('127.0.0.1:11211 (1)', {})]

            def replace(self, key, value, time, min_compress_len):
                """
                Mock of replace method
                """
                self.key = key
                self.value = value
                self.time = time
                self.min_compress_len = min_compress_len
                return True

        with patch.object(memcached, '_connect',
                          MagicMock(return_value=MockMemcache())):
            self.assertTrue(memcached.replace('salt', '1111'))

            self.assertRaises(SaltInvocationError, memcached.replace,
                              'salt', '1111', time='0.1')

            self.assertRaises(SaltInvocationError, memcached.replace,
                              'salt', '1111', min_compress_len='0.1')

    # 'increment' function tests: 3
Return a list of slices given a window size.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/memcached_test.py/MemcachedTestCase.test_replace--crossover with--dataset/ETHPy150Open cgarrard/osgeopy-code/ospybook/ospybook/__init__.py/make_masked_slices