Beispiel #1
0
    def testOutputEqualsInput(self):
        """Tests that setting outputdir == inputdir fails always"""
        from Ganga.GPI import TextMerger

        self.runJobSlice()
        tm = TextMerger(overwrite=True)
        tm.files = ['out.txt']

        for j in self.jobslice:
            with pytest.raises(PostProcessException):
                tm.merge(self.jobslice, outputdir=j.outputdir)
Beispiel #2
0
    def testOutputEqualsInput(self):
        """Tests that setting outputdir == inputdir fails always"""
        from Ganga.GPI import TextMerger

        self.runJobSlice()
        tm = TextMerger(overwrite=True)
        tm.files = ['out.txt']

        for j in self.jobslice:
            with pytest.raises(PostProcessException):
                tm.merge(self.jobslice, outputdir=j.outputdir)
Beispiel #3
0
    def testStructureOfMerger(self):
        """Test that structure in the output sandbox is recreated in the merge"""
        from Ganga.GPI import TextMerger
        self.runJobSlice()

        tm = TextMerger()
        tm.files = ['out.txt', 'subdir/out.txt']

        tmpdir = tempfile.mktemp()
        os.mkdir(tmpdir)

        assert tm.merge(self.jobslice, tmpdir), 'Merge must run correctly'
        assert os.path.exists(os.path.join(tmpdir, 'out.txt')), 'Merge must produce the file'
Beispiel #4
0
    def testStructureOfMerger(self):
        """Test that structure in the output sandbox is recreated in the merge"""
        from Ganga.GPI import TextMerger
        self.runJobSlice()

        tm = TextMerger()
        tm.files = ['out.txt', 'subdir/out.txt']

        tmpdir = tempfile.mktemp()
        os.mkdir(tmpdir)

        assert tm.merge(self.jobslice, tmpdir), 'Merge must run correctly'
        assert os.path.exists(os.path.join(
            tmpdir, 'out.txt')), 'Merge must produce the file'