Respect timeout when doing get_file_data
[ruby-mogilefs-client.git] / test / test_bigfile.rb
blob6bc78cd60cd2290e47106f7c4263a2559e81693c
1 require 'test/setup'
2 require 'mogilefs/bigfile'
4 class TestMogileFS__Bigfile < TestMogileFS
5   include MogileFS::Bigfile
7   def setup
8     @klass = MogileFS::MogileFS
9     super
10   end
12   def test_parser
13     expect = {:type=>"file",
14      :des=>"no description",
15      :chunks=>2,
16      :parts=>
17       [nil,
18        {:md5=>"d3b4d15c294b24d9f853e26095dfe3d0",
19         :paths=>
20          ["http://foo1:7500/dev2/0/000/144/0000144411.fid",
21           "http://foo2:7500/dev1/0/000/144/0000144411.fid"],
22         :bytes=>12},
23        {:md5=>"d3b4d15c294b24d9f853e26095dfe3d0",
24         :paths=>
25          ["http://foo4:7500/dev2/0/000/144/0000144411.fid",
26           "http://foo3:7500/dev1/0/000/144/0000144411.fid"],
27         :bytes=>6}],
28      :size=>18,
29      :filename=>"foo.tar",
30      :compressed=>false}
32     s = <<EOS
33 des no description
34 type file
35 compressed 0
36 filename foo.tar
37 chunks 2
38 size 18
40 part 1 bytes=12 md5=d3b4d15c294b24d9f853e26095dfe3d0 paths: http://foo1:7500/dev2/0/000/144/0000144411.fid, http://foo2:7500/dev1/0/000/144/0000144411.fid
41 part 2 bytes=6 md5=d3b4d15c294b24d9f853e26095dfe3d0 paths: http://foo4:7500/dev2/0/000/144/0000144411.fid, http://foo3:7500/dev1/0/000/144/0000144411.fid
42 EOS
43     i = parse_info(s)
44     assert_equal expect, i
45   end
47 end