3
require File.expand_path(File.dirname(__FILE__) + '/../../lib/puppettest')
6
require 'puppet/file_bucket/dipper'
8
class TestDipperClient < Test::Unit::TestCase
9
include PuppetTest::ServerTest
13
@dipper = Puppet::FileBucket::Dipper.new(:Path => tempfile)
16
# Make sure we can create a new file with 'restore'.
17
def test_restore_to_new_file
19
text = "asdf;lkajseofiqwekj"
20
File.open(file, "w") { |f| f.puts text }
22
assert_nothing_raised("Could not send file") do
23
md5 = @dipper.backup(file)
27
assert_nothing_raised("could not restore to new path") do
28
@dipper.restore(newfile, md5)
31
assert_equal(File.read(file), File.read(newfile), "did not restore correctly")