Sha256: 77714d1d9e40b5fcbb1bb62215a7aa42981ad7e35668b0d8ba9a4d44b7aeaad3

Contents?: true

Size: 826 Bytes

Versions: 12

Compression:

Stored size: 826 Bytes

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../../lib/puppettest'

require 'puppettest'
require 'puppet/file_bucket/dipper'

class TestDipperClient < Test::Unit::TestCase
  include PuppetTest::ServerTest

  def setup
    super
    @dipper = Puppet::FileBucket::Dipper.new(:Path => tempfile)
  end

  # Make sure we can create a new file with 'restore'.
  def test_restore_to_new_file
    file = tempfile
    text = "asdf;lkajseofiqwekj"
    File.open(file, "w") { |f| f.puts text }
    md5 = nil
    assert_nothing_raised("Could not send file") do
      md5 = @dipper.backup(file)
    end

    newfile = tempfile
    assert_nothing_raised("could not restore to new path") do
      @dipper.restore(newfile, md5)
    end

    assert_equal(File.read(file), File.read(newfile), "did not restore correctly")
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
puppet-2.6.11 test/network/client/dipper.rb
puppet-2.6.10 test/network/client/dipper.rb
puppet-2.6.9 test/network/client/dipper.rb
puppet-2.6.8 test/network/client/dipper.rb
puppet-2.6.7 test/network/client/dipper.rb
puppet-2.6.6 test/network/client/dipper.rb
puppet-2.6.5 test/network/client/dipper.rb
puppet-2.6.4 test/network/client/dipper.rb
puppet-2.6.3 test/network/client/dipper.rb
puppet-2.6.2 test/network/client/dipper.rb
puppet-2.6.1 test/network/client/dipper.rb
puppet-2.6.0 test/network/client/dipper.rb