Example #1
0
    def test_join_files_local_fail(self, monkeypatch: MonkeyPatch):
        def isfile(path):
            return False

        def glob(path):
            return ["file1", "file2"]

        monkeypatch.setattr("glob.glob", glob)
        monkeypatch.setattr("builtins.open", MockOpen)
        monkeypatch.setattr("os.path.isfile", isfile)
        monkeypatch.setattr("os.path.sep", "/")
        scget = SplitCopyGet()
        scget.remote_file = "foo"
        scget.local_file = "foo"
        scget.local_dir = "/var/tmp"
        scget.scs = MockSplitCopyShared()
        with raises(SystemExit):
            scget.join_files_local()
Example #2
0
    def test_join_files_local(self, monkeypatch: MonkeyPatch):
        def isfile(path):
            return True

        def glob(path):
            return ["file1", "file2"]

        monkeypatch.setattr("glob.glob", glob)
        monkeypatch.setattr("builtins.open", MockOpen)
        monkeypatch.setattr("os.path.isfile", isfile)
        monkeypatch.setattr("os.path.sep", "/")
        scget = SplitCopyGet()
        scget.remote_file = "foo"
        scget.local_file = "foo"
        scget.local_dir = "/var/tmp"
        scget.scs = MockSplitCopyShared()

        result = scget.join_files_local()
        assert result == None