示例#1
0
 def test_links_files_dirs(self, _link):
     lh = LocalHandler("/some/file")
     # symbolic link
     options = {"method": "link"}
     self.assertTrue(lh.get("foo", options))
     _link.assert_called_with("/some/file", "foo")
     # hard link
     options = {"method": "hardlink"}
     self.assertTrue(lh.get("foo", options))
     _link.assert_called_with("/some/file", "foo", symbolic=False)
示例#2
0
 def test_links_files_dirs(self, _link):
     lh = LocalHandler("/some/file")
     # symbolic link
     options = {"method": "link"}
     self.assertTrue(lh.get("foo", options))
     _link.assert_called_with("/some/file", "foo")
     # hard link
     options = {"method": "hardlink"}
     self.assertTrue(lh.get("foo", options))
     _link.assert_called_with("/some/file", "foo", symbolic=False)
示例#3
0
 def test_copy_is_default(self, _copy):
     lh = LocalHandler("/some/file")
     self.assertTrue(lh.get("foo"))
     _copy.assert_called_with("/some/file", "foo")
示例#4
0
 def test_rsyncs_files_dirs(self, _rsync):
     lh = LocalHandler("/some/file")
     options = {"method": "rsync"}
     self.assertTrue(lh.get("foo", options))
     _rsync.assert_called_with("/some/file", "foo")
示例#5
0
 def test_copies_files_dirs(self, _copy):
     lh = LocalHandler("/some/file")
     options = {"method": "copy"}
     self.assertTrue(lh.get("foo", options))
     _copy.assert_called_with("/some/file", "foo")
示例#6
0
 def test_creates_directory(self, _mkdir):
     lh = LocalHandler("@")
     self.assertTrue(lh.get("foo"))
     _mkdir.assert_called_with('foo', overwrite=False)
示例#7
0
 def test_copy_is_default(self, _copy):
     lh = LocalHandler("/some/file")
     self.assertTrue(lh.get("foo"))
     _copy.assert_called_with("/some/file", "foo")
示例#8
0
 def test_rsyncs_files_dirs(self, _rsync):
     lh = LocalHandler("/some/file")
     options = {"method": "rsync"}
     self.assertTrue(lh.get("foo", options))
     _rsync.assert_called_with("/some/file", "foo")
示例#9
0
 def test_copies_files_dirs(self, _copy):
     lh = LocalHandler("/some/file")
     options = {"method": "copy"}
     self.assertTrue(lh.get("foo", options))
     _copy.assert_called_with("/some/file", "foo")
示例#10
0
 def test_creates_directory(self, _mkdir):
     lh = LocalHandler("@")
     self.assertTrue(lh.get("foo"))
     _mkdir.assert_called_with('foo', overwrite=False)