test bup special remote (74% coverage)

This commit is contained in:
Joey Hess 2011-12-21 13:50:33 -04:00
parent c61f3d7b7b
commit 8cdcd78b21
2 changed files with 20 additions and 1 deletions

2
debian/changelog vendored
View file

@ -5,7 +5,7 @@ git-annex (3.20111212) UNRELEASED; urgency=low
* Properly handle multiline git config values.
* Fix the hook special remote, which bitrotted a while ago.
* map: --fast disables use of dot to display map
* Test suite improvements. Current top-level test coverage: 72%
* Test suite improvements. Current top-level test coverage: 74%
-- Joey Hess <joeyh@debian.org> Mon, 12 Dec 2011 01:57:49 -0400

19
test.hs
View file

@ -119,6 +119,7 @@ blackbox = TestLabel "blackbox" $ TestList
, test_hook_remote
, test_directory_remote
, test_rsync_remote
, test_bup_remote
, test_crypto
]
@ -638,6 +639,24 @@ test_rsync_remote = "git-annex rsync remote" ~: intmpclonerepo $ do
not <$> git_annex "drop" [annexedfile, "--numcopies=2"] @? "drop failed to fail"
annexed_present annexedfile
test_bup_remote :: Test
test_bup_remote = "git-annex bup remote" ~: intmpclonerepo $ checkbup $ do
dir <- absPath "dir" -- bup special remote needs an absolute path
createDirectory dir
git_annex "initremote" (words $ "foo type=bup encryption=none buprepo="++dir) @? "initremote failed"
git_annex "get" [annexedfile] @? "get of file failed"
annexed_present annexedfile
git_annex "copy" [annexedfile, "--to", "foo"] @? "copy --to bup remote failed"
annexed_present annexedfile
git_annex "drop" [annexedfile, "--numcopies=2"] @? "drop failed"
annexed_notpresent annexedfile
git_annex "copy" [annexedfile, "--from", "foo"] @? "copy --from bup remote failed"
annexed_present annexedfile
not <$> git_annex "move" [annexedfile, "--from", "foo"] @? "move --from bup remote failed to fail"
annexed_present annexedfile
where
checkbup = whenM (inPath "bup")
test_crypto :: Test
test_crypto = "git-annex crypto" ~: intmpclonerepo $
-- gpg is not a build dependency, so only test when it's available