diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-11 20:58:25 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-11 20:58:25 +0000 |
| commit | 8063ab1f573e7d4404fddca62a4134b2254f8d1d (patch) | |
| tree | d0f3137b7839f2450b3ab1ca22b392053c75c6b8 /test/server/bucket.rb | |
| parent | 1ab45947dab40a99c331a5dc550dc00f54dc3180 (diff) | |
| download | puppet-8063ab1f573e7d4404fddca62a4134b2254f8d1d.tar.gz puppet-8063ab1f573e7d4404fddca62a4134b2254f8d1d.tar.xz puppet-8063ab1f573e7d4404fddca62a4134b2254f8d1d.zip | |
Fixing filebucket server so that paths are not added multiple times
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1392 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/server/bucket.rb')
| -rw-r--r-- | test/server/bucket.rb | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/test/server/bucket.rb b/test/server/bucket.rb index 8171b2740..af2fd0865 100644 --- a/test/server/bucket.rb +++ b/test/server/bucket.rb @@ -140,9 +140,7 @@ class TestBucket < Test::Unit::TestCase def setup super - @bucket = File.join(Puppet[:confdir], "buckettesting") - - @@tmpfiles << @bucket + @bucket = tempfile() end #def teardown @@ -240,6 +238,29 @@ class TestBucket < Test::Unit::TestCase end Process.kill("TERM", pid) end + + def test_no_path_duplicates + bucket = nil + assert_nothing_raised { + bucket = Puppet::Server::FileBucket.new( + :Bucket => @bucket + ) + } + + sum = nil + assert_nothing_raised { + sum = bucket.addfile("yayness", "/my/file") + } + assert_nothing_raised { + bucket.addfile("yayness", "/my/file") + } + + pathfile = File.join(bucket.path, sum, "paths") + + assert(FileTest.exists?(pathfile), "No path file at %s" % pathfile) + + assert_equal("/my/file\n", File.read(pathfile)) + end end # $Id$ |
