def METHOD_NAME(self, filename=None, protocol=None):
    os.mkdir(self.dirname)
    self.addCleanup(os_helper.rmtree, self.dirname)
    s = shelve.open(filename=filename if filename is not None else self.fn,
                    protocol=protocol)
    try:
        s['key1'] = (1,2,3,4)
        self.assertEqual(s['key1'], (1,2,3,4))
    finally:
        s.close()