about summary refs log tree commit homepage
path: root/test/test_mogilefs_integration_list_keys.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-10-08 22:44:03 +0000
committerEric Wong <normalperson@yhbt.net>2012-10-09 00:17:16 +0000
commit436f57af99152d62c8c56fda394cbb2159747fe9 (patch)
tree3f01ff22e6b4d9c6ca52ec9cd9bb275bb087f1cd /test/test_mogilefs_integration_list_keys.rb
parentef987fde476bd9d36a6514acd50cf94fc8081063 (diff)
downloadmogilefs-client-436f57af99152d62c8c56fda394cbb2159747fe9.tar.gz
This allows fast listing of keys and metadata (length,
checksum, devcount, class).
Diffstat (limited to 'test/test_mogilefs_integration_list_keys.rb')
-rw-r--r--test/test_mogilefs_integration_list_keys.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_mogilefs_integration_list_keys.rb b/test/test_mogilefs_integration_list_keys.rb
index 6c62e6b..1de6cda 100644
--- a/test/test_mogilefs_integration_list_keys.rb
+++ b/test/test_mogilefs_integration_list_keys.rb
@@ -36,5 +36,21 @@ class TestMogileFSIntegrationListKeys < TestMogIntegration
       assert_equal "ek_#{n.to_s}", key
       n += 1
     end
+    assert_equal 9, n
+  end
+
+  def test_each_file_info
+    9.times { |i| @client.store_content("ek_#{i}", nil, i.to_s) }
+    n = 0
+    @client.each_file_info do |info|
+      assert_equal @client.domain, info["domain"]
+      assert_equal n.to_s.size, info["length"]
+      assert_kind_of Integer, info["fid"]
+      assert_kind_of Integer, info["devcount"]
+      assert_equal "default", info["class"]
+      assert_equal "ek_#{n}", info["key"]
+      n += 1
+    end
+    assert_equal 9, n
   end
 end