@cryptotaxi247 / kubo / commits / 8c78d4072

pinning: test pinning/unpinning files in sharded directories

License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Jun 12, 2017 at 19:02 UTC 8c78d4072dcf57fba697a8342711005011826bad
1 file changed +10
test/sharness/t0250-files-api.sh
+10
@@ -72,6 +72,16 @@ test_sharding() {
72 test_cmp file_out file_exp
73 '
74
75 + test_expect_success "can pin a file from sharded directory" '
76 + ipfs files stat --hash /foo/file42 > pin_file_hash &&
77 + ipfs pin add < pin_file_hash > pin_hash
78 + '
79 +
80 + test_expect_success "can unpin a file from sharded directory" '
81 + read -r _ HASH _ < pin_hash &&
82 + ipfs pin rm $HASH
83 + '
84 +
85 test_expect_success "output object was really sharded" '
86 ipfs files stat --hash /foo > expected_foo_hash &&
87 echo QmPkwLJTYZRGPJ8Lazr9qPdrLmswPtUjaDbEpmR9jEh1se > actual_foo_hash &&