Beispiel #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)
Beispiel #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)
Beispiel #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")
Beispiel #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")
Beispiel #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")
Beispiel #6
0
 def test_creates_directory(self, _mkdir):
     lh = LocalHandler("@")
     self.assertTrue(lh.get("foo"))
     _mkdir.assert_called_with('foo', overwrite=False)
Beispiel #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")
Beispiel #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")
Beispiel #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")
Beispiel #10
0
 def test_creates_directory(self, _mkdir):
     lh = LocalHandler("@")
     self.assertTrue(lh.get("foo"))
     _mkdir.assert_called_with('foo', overwrite=False)