4 class MogileFS::Backend
5 attr_accessor :timeout, :lasterr, :lasterrstr, :hosts
12 class TestClient < Test::Unit::TestCase
15 @client = MogileFS::Client.new :hosts => ['kaa:6001']
19 client = MogileFS::Client.new :hosts => ['kaa:6001']
21 assert_instance_of MogileFS::Backend, client.backend
22 assert_equal ['kaa:6001'], client.hosts
24 client = MogileFS::Client.new :hosts => ['kaa:6001'], :timeout => 5
25 assert_equal 5, client.backend.timeout
29 @client.backend.lasterr = 'you'
30 assert_equal 'you', @client.err
34 @client.backend.lasterrstr = 'totally suck'
35 assert_equal 'totally suck', @client.errstr
39 orig_backend = @client.backend
41 @client.hosts = ['ziz:6001']
44 assert_not_same @client.backend, orig_backend
45 assert_equal ['ziz:6001'], @client.backend.hosts
48 def test_readonly_eh_readonly
49 client = MogileFS::Client.new :hosts => ['kaa:6001'], :readonly => true
50 assert_equal true, client.readonly?
53 def test_readonly_eh_readwrite
54 assert_equal false, @client.readonly?