Example #1
0
    def test_update_checkout_url(self, svn_path_exists):
        impl = SVNImplementation(Mock())
        opts = impl._repo.app.config.options = {}

        svn_path_exists.side_effect = lambda path: False
        opts['checkout_url'] = 'invalid'
        impl.update_checkout_url()
        assert_equal(opts['checkout_url'], '')

        svn_path_exists.side_effect = lambda path: path.endswith('trunk')
        opts['checkout_url'] = 'invalid'
        impl.update_checkout_url()
        assert_equal(opts['checkout_url'], 'trunk')

        svn_path_exists.side_effect = lambda path: path.endswith('trunk')
        opts['checkout_url'] = ''
        impl.update_checkout_url()
        assert_equal(opts['checkout_url'], 'trunk')
    def test_update_checkout_url(self, svn_path_exists):
        impl = SVNImplementation(Mock())
        opts = impl._repo.app.config.options = {}

        svn_path_exists.side_effect = lambda path: False
        opts['checkout_url'] = 'invalid'
        impl.update_checkout_url()
        assert_equal(opts['checkout_url'], '')

        svn_path_exists.side_effect = lambda path: path.endswith('trunk')
        opts['checkout_url'] = 'invalid'
        impl.update_checkout_url()
        assert_equal(opts['checkout_url'], 'trunk')

        svn_path_exists.side_effect = lambda path: path.endswith('trunk')
        opts['checkout_url'] = ''
        impl.update_checkout_url()
        assert_equal(opts['checkout_url'], 'trunk')