def METHOD_NAME(self):
    self.log.info("Generating initial blockchain")
    self.nodes[0].generate(1)
    sync_blocks(self.nodes)
    self.nodes[1].generate(1)
    sync_blocks(self.nodes)
    self.nodes[2].generate(1)
    sync_blocks(self.nodes)
    self.nodes[3].generate(100)
    sync_blocks(self.nodes)
    assert_equal(self.nodes[0].getbalance(), 50)
    assert_equal(self.nodes[1].getbalance(), 50)
    assert_equal(self.nodes[2].getbalance(), 50)
    assert_equal(self.nodes[3].getbalance(), 0)
    self.log.info("Creating transactions")
    # Five rounds of sending each other transactions.
    for i in range(5):
        self.do_one_round()
    self.log.info("Backing up")
    self.nodes[0].backupwallet(os.path.join(self.nodes[0].datadir, 'wallet.bak'))
    self.nodes[0].dumpwallet(os.path.join(self.nodes[0].datadir, 'wallet.dump'))
    self.nodes[1].backupwallet(os.path.join(self.nodes[1].datadir, 'wallet.bak'))
    self.nodes[1].dumpwallet(os.path.join(self.nodes[1].datadir, 'wallet.dump'))
    self.nodes[2].backupwallet(os.path.join(self.nodes[2].datadir, 'wallet.bak'))
    self.nodes[2].dumpwallet(os.path.join(self.nodes[2].datadir, 'wallet.dump'))
    self.log.info("More transactions")
    for i in range(5):
        self.do_one_round()
    # Generate 101 more blocks, so any fees paid mature
    self.nodes[3].generate(101)
    self.sync_all()
    balance0 = self.nodes[0].getbalance()
    balance1 = self.nodes[1].getbalance()
    balance2 = self.nodes[2].getbalance()
    balance3 = self.nodes[3].getbalance()
    total = balance0 + balance1 + balance2 + balance3
    # At this point, there are 214 blocks (103 for setup, then 10 rounds, then 101.)
    # 114 are mature, so the sum of all wallets should be 114 * 50 = 5700.
    assert_equal(total, 5700)
    ##
    # Test restoring spender wallets from backups
    ##
    self.log.info("Restoring using wallet.dat")
    self.stop_three()
    self.erase_three()
    # Start node2 with no chain
    shutil.rmtree(os.path.join(self.nodes[2].datadir, 'regtest', 'blocks'))
    shutil.rmtree(os.path.join(self.nodes[2].datadir, 'regtest', 'chainstate'))
    # Restore wallets from backup
    shutil.copyfile(os.path.join(self.nodes[0].datadir, 'wallet.bak'), os.path.join(self.nodes[0].datadir, 'regtest', 'wallets', 'wallet.dat'))
    shutil.copyfile(os.path.join(self.nodes[1].datadir, 'wallet.bak'), os.path.join(self.nodes[1].datadir, 'regtest', 'wallets', 'wallet.dat'))
    shutil.copyfile(os.path.join(self.nodes[2].datadir, 'wallet.bak'), os.path.join(self.nodes[2].datadir, 'regtest', 'wallets', 'wallet.dat'))
    self.log.info("Re-starting nodes")
    self.start_three()
    sync_blocks(self.nodes)
    assert_equal(self.nodes[0].getbalance(), balance0)
    assert_equal(self.nodes[1].getbalance(), balance1)
    assert_equal(self.nodes[2].getbalance(), balance2)
    self.log.info("Restoring using dumped wallet")
    self.stop_three()
    self.erase_three()
    #start node2 with no chain
    shutil.rmtree(os.path.join(self.nodes[2].datadir, 'regtest', 'blocks'))
    shutil.rmtree(os.path.join(self.nodes[2].datadir, 'regtest', 'chainstate'))
    self.start_three()
    assert_equal(self.nodes[0].getbalance(), 0)
    assert_equal(self.nodes[1].getbalance(), 0)
    assert_equal(self.nodes[2].getbalance(), 0)
    self.nodes[0].importwallet(os.path.join(self.nodes[0].datadir, 'wallet.dump'))
    self.nodes[1].importwallet(os.path.join(self.nodes[1].datadir, 'wallet.dump'))
    self.nodes[2].importwallet(os.path.join(self.nodes[2].datadir, 'wallet.dump'))
    sync_blocks(self.nodes)
    assert_equal(self.nodes[0].getbalance(), balance0)
    assert_equal(self.nodes[1].getbalance(), balance1)
    assert_equal(self.nodes[2].getbalance(), balance2)
    # Backup to source wallet file must fail
    sourcePaths = [
        os.path.join(self.nodes[0].datadir, 'regtest', 'wallets', 'wallet.dat'),
        os.path.join(self.nodes[0].datadir, 'regtest', '.', 'wallets', 'wallet.dat'),
        os.path.join(self.nodes[0].datadir, 'regtest', 'wallets', ''),
        os.path.join(self.nodes[0].datadir, 'regtest', 'wallets')]
    for sourcePath in sourcePaths:
        assert_raises_rpc_error(-4, "backup failed", self.nodes[0].backupwallet, sourcePath)