def test_update_svn(self):
        """Verify that SVN update is called with the correct parameters."""
        from pygeoprocessing.testing.scm import checkout_svn

        with mock.patch('subprocess.call'):
            checkout_svn(self.workspace, 'svn://foo')
            self.assertTrue(subprocess.call.called)
            self.assertEqual(subprocess.call.call_args[0][0],
                             ['svn', 'update', '-r', 'HEAD'])
    def test_update_svn_to_rev(self):
        """Verify SVN update -r <rev> is called with the correct params."""
        from pygeoprocessing.testing.scm import checkout_svn

        with mock.patch('subprocess.call'):
            checkout_svn(self.workspace, 'svn://foo', rev='25')
            self.assertTrue(subprocess.call.called)
            self.assertEqual(subprocess.call.call_args[0][0],
                             ['svn', 'update', '-r', '25'])
    def test_checkout_svn(self):
        """Verify that SVN checkout is called with the correct parameters."""
        from pygeoprocessing.testing.scm import checkout_svn
        nonexistent_folder = os.path.join(self.workspace, 'dir_not_found')
        remote_path = 'svn://foo'

        with mock.patch('subprocess.call'):
            checkout_svn(nonexistent_folder, remote_path)
            self.assertTrue(subprocess.call.called)
            self.assertEqual(subprocess.call.call_args[0][0], [
                'svn', 'checkout', remote_path, nonexistent_folder, '-r',
                'HEAD'
            ])