1 # -*- encoding: binary -*-
4 class TestMogFresh < Test::Unit::TestCase
6 alias setup setup_mogilefs
7 alias teardown teardown_mogilefs
9 def test_change_device_weight
10 add_host_device_domain
11 assert_equal true, @admin.change_device_weight("me", 1, 50)
12 assert_equal 50, @admin.get_devices(1)[0]["weight"]
15 def test_list_keys_invalid_domain
16 add_host_device_domain
17 domain = @domain + ".non-existent"
18 client = MogileFS::MogileFS.new :hosts => @hosts, :domain => domain
19 assert_raises(MogileFS::Backend::UnregDomainError) do
24 def test_invalid_key_exists
25 add_host_device_domain
26 domain = @domain + ".non-existent"
27 client = MogileFS::MogileFS.new :hosts => @hosts, :domain => domain
28 assert_raises(MogileFS::Backend::UnregDomainError) do
32 client = MogileFS::MogileFS.new :hosts => @hosts, :domain => @domain
33 assert_equal false, client.exist?("non-existent")