7 class TestClient < Test::Unit::TestCase
10 @client = MogileFS::Client.new :hosts => ['kaa:6001']
14 client = MogileFS::Client.new :hosts => ['kaa:6001']
16 assert_instance_of MogileFS::Backend, client.backend
17 assert_equal ['kaa:6001'], client.hosts
19 client = MogileFS::Client.new :hosts => ['kaa:6001'], :timeout => 5
20 assert_equal 5, client.backend.timeout
24 @client.backend.lasterr = 'you'
25 assert_equal 'you', @client.err
29 @client.backend.lasterrstr = 'totally suck'
30 assert_equal 'totally suck', @client.errstr
34 orig_backend = @client.backend
36 @client.hosts = ['ziz:6001']
39 assert_not_same @client.backend, orig_backend
40 assert_equal ['ziz:6001'], @client.backend.hosts
43 def test_readonly_eh_readonly
44 client = MogileFS::Client.new :hosts => ['kaa:6001'], :readonly => true
45 assert_equal true, client.readonly?
48 def test_readonly_eh_readwrite
49 assert_equal false, @client.readonly?