@patch('shutil.move')
    @pytest.mark.parametrize("config", [("test_pypdfocr_config.yaml"), ("test_pypdfocr_config_no_move_original.yaml")])
    @pytest.mark.parametrize("dirname, tgt_folder, filename, expected", pdf_tests[0:3])
    def test_standalone_filing(self, mock_move, config, dirname, tgt_folder, filename, expected):

        # Mock the move function so we don't actually end up filing
        cwd = os.getcwd()
        if os.path.exists("temp"):
            os.chdir("temp")
            for d in [os.path.join('target', 'patents'), os.path.join('target','recipe')]:
                if os.path.exists(d):
                    os.removedirs(d)
            os.chdir(cwd)

        os.chdir(dirname)
        print("Current direcxtory: %s" % os.getcwd())
        #opts = [filename, "--config=test_pypdfocr_config.yaml", "-f"]
        opts = [filename, '--skip-preprocess', "--config=%s" % config, "-f"]
        self.p.go(opts)

        out_filename = filename.replace(".pdf", "_ocr.pdf")
        assert(os.path.exists(out_filename))
        for i,t in enumerate(self._iter_pdf(out_filename)):
            if len(expected) > i:
                for keyword in expected[i]:
                    assert(keyword in t)
            print ("\n----------------------\nPage %d\n" % i)
            print t
        os.remove(out_filename)
        os.chdir(cwd)
        
        # Assert the smtp calls
        calls = [call(out_filename,
                        os.path.abspath(os.path.join(tgt_folder,os.path.basename(out_filename))))]
        if not "no_move_original" in config:
            new_file_name = os.path.basename(filename).replace(".pdf", "_2.pdf")
            calls.append(call(filename,
                                os.path.abspath(os.path.join("temp","original", new_file_name))))
        mock_move.assert_has_calls(calls)
Test filing of single pdf.  Also test moving of original file.
dataset/ETHPy150Open virantha/pypdfocr/test/test_pypdfocr.py/TestPydfocr.test_standalone_filing