def test_svn_path_exists(self):
     repo_path = pkg_resources.resource_filename('forgesvn',
                                                 'tests/data/testsvn')
     assert svn_path_exists("file://%s/a" % repo_path)
     assert svn_path_exists("file://%s" % repo_path)
     assert not svn_path_exists("file://%s/badpath" % repo_path)
     with mock.patch('forgesvn.model.svn.pysvn') as pysvn:
         svn_path_exists('dummy')
         pysvn.Client.return_value.info2.assert_called_once_with(
             'dummy', revision=pysvn.Revision.return_value, recurse=False)
Example #2
0
 def test_svn_path_exists(self):
     repo_path = pkg_resources.resource_filename(
         'forgesvn', 'tests/data/testsvn')
     assert svn_path_exists("file://%s/a" % repo_path)
     assert svn_path_exists("file://%s" % repo_path)
     assert not svn_path_exists("file://%s/badpath" % repo_path)
     with mock.patch('forgesvn.model.svn.pysvn') as pysvn:
         svn_path_exists('dummy')
         pysvn.Client.return_value.info2.assert_called_once_with(
             'dummy',
             revision=pysvn.Revision.return_value,
             recurse=False)
Example #3
0
 def execute(cls, options):
     query = {'tool_name': {'$regex': '^svn$', '$options': 'i'},
              'options.checkout_url': ''}
     for chunk in utils.chunked_find(M.AppConfig, query):
         for config in chunk:
             repo = Repository.query.get(app_config_id=config._id)
             trunk_path = "file://{0}{1}/trunk".format(repo.fs_path, repo.name)
             if svn_path_exists(trunk_path):
                 config.options['checkout_url'] = "trunk"
                 log.info("Update checkout_url for: %s", trunk_path)
         ThreadLocalORMSession.flush_all()
 def test_svn_path_exists(self):
     repo_path = pkg_resources.resource_filename(
         'forgesvn', 'tests/data/testsvn')
     assert svn_path_exists("file://%s/a" % repo_path)
     assert svn_path_exists("file://%s" % repo_path)
     assert not svn_path_exists("file://%s/badpath" % repo_path)
 def test_svn_path_exists(self):
     repo_path = pkg_resources.resource_filename('forgesvn',
                                                 'tests/data/testsvn')
     assert svn_path_exists("file://%s/a" % repo_path)
     assert svn_path_exists("file://%s" % repo_path)
     assert not svn_path_exists("file://%s/badpath" % repo_path)