Changeset - d5e42c00f3c1
[Not reviewed]
beta
0 27 0
Marcin Kuzminski - 13 years ago 2012-07-27 01:06:50
marcin@python-works.com
white space cleanup
7 files changed with 5 insertions and 10 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/rcmail/utils.py
Show inline comments
 
"""
 
Email message and email sending related helper functions.
 
"""
 

	
 
import socket
 

	
 

	
 
# Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
 
# seconds, which slows down the restart of the server.
 
class CachedDnsName(object):
 
    def __str__(self):
 
        return self.get_fqdn()
 

	
 
    def get_fqdn(self):
 
        if not hasattr(self, '_fqdn'):
 
            self._fqdn = socket.getfqdn()
 
        return self._fqdn
 

	
 
DNS_NAME = CachedDnsName()
 
\ No newline at end of file
 
DNS_NAME = CachedDnsName()
rhodecode/templates/admin/users/user_edit_my_account_repos.html
Show inline comments
 
@@ -22,25 +22,25 @@
 
                ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
 
              </td>
 
              ##LAST REVISION
 
              <td>
 
                  ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
 
              </td>
 
              <td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url('/images/icons/application_form_edit.png')}"/></a></td>
 
              <td>
 
                ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')}
 
                  ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo['name']+"');")}
 
                ${h.end_form()}
 
              </td>
 
          </tr>
 
       %endfor
 
   %else:
 
      <div style="padding:5px 0px 10px 0px;">
 
      ${_('No repositories yet')}
 
      %if h.HasPermissionAny('hg.admin','hg.create.repository')():
 
          ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")}
 
      %endif
 
      </div>
 
   %endif
 
   </tbody>
 
   </table>
 
</div>
 
\ No newline at end of file
 
</div>
rhodecode/tests/api/api_base.py
Show inline comments
 
@@ -967,25 +967,24 @@ class BaseTestApi(object):
 
        response = self.app.post(API_URL, content_type='application/json',
 
                                 params=params)
 

	
 
        expected = {
 
            'msg': 'Revoked perm for users group: `%s` in repo: `%s`' % (
 
                TEST_USERS_GROUP, self.REPO
 
            ),
 
            'success': True
 
        }
 
        self._compare_ok(id_, expected, given=response.body)
 

	
 
    @mock.patch.object(RepoModel, 'revoke_users_group_permission', crash)
 
    def test_api_revoke_users_group_permission_exception_when_adding(self):
 

	
 
        id_, params = _build_data(self.apikey, 'revoke_users_group_permission',
 
                                  repoid=self.REPO,
 
                                  usersgroupid=TEST_USERS_GROUP,)
 
        response = self.app.post(API_URL, content_type='application/json',
 
                                 params=params)
 

	
 
        expected = 'failed to edit permission for users group: `%s` in repo: `%s`' % (
 
                    TEST_USERS_GROUP, self.REPO
 
                )
 
        self._compare_error(id_, expected, given=response.body)
 

	
rhodecode/tests/api/test_api_hg.py
Show inline comments
 
from rhodecode.tests import *
 
from rhodecode.tests.api.api_base import BaseTestApi
 

	
 

	
 
class TestHgApi(BaseTestApi, TestController):
 
    REPO = HG_REPO
 
    REPO_TYPE = 'hg'
 
\ No newline at end of file
 
    REPO_TYPE = 'hg'
rhodecode/tests/functional/test_admin_settings.py
Show inline comments
 
@@ -242,25 +242,25 @@ class TestAdminSettingsController(TestCo
 
        response.mustcontain(opt)
 

	
 
        # clean session flash
 
        #response = self.app.get(url('edit_repo', repo_name=HG_REPO))
 

	
 
        ## mark it as None
 
        response = self.app.put(url('repo_as_fork', repo_name=HG_REPO),
 
                                 params=dict(
 
                                    id_fork_of=None
 
                                 ))
 
        repo = Repository.get_by_repo_name(HG_REPO)
 
        repo2 = Repository.get_by_repo_name(GIT_REPO)
 
        self.checkSessionFlash(response,
 
        'Marked repo %s as fork of %s' % (repo.repo_name, "Nothing"))
 
        assert repo.fork == None
 

	
 
    def test_set_fork_of_same_repo(self):
 
        self.log_user()
 
        repo = Repository.get_by_repo_name(HG_REPO)
 
        response = self.app.put(url('repo_as_fork', repo_name=HG_REPO),
 
                                 params=dict(
 
                                    id_fork_of=repo.repo_id
 
                                 ))
 
        self.checkSessionFlash(response,
 
                               'An error occurred during this operation')
 
\ No newline at end of file
 
                               'An error occurred during this operation')
rhodecode/tests/models/test_notifications.py
Show inline comments
 
@@ -164,28 +164,24 @@ class TestNotifications(unittest.TestCas
 

	
 
        NotificationModel().create(created_by=self.u1,
 
                            subject=u'title', body=u'hi there_delete',
 
                            recipients=[self.u3, self.u1])
 
        Session().commit()
 

	
 
        self.assertEqual(NotificationModel()
 
                         .get_unread_cnt_for_user(self.u1), 1)
 
        self.assertEqual(NotificationModel()
 
                         .get_unread_cnt_for_user(self.u2), 0)
 
        self.assertEqual(NotificationModel()
 
                         .get_unread_cnt_for_user(self.u3), 1)
 

	
 
        notification = NotificationModel().create(created_by=self.u1,
 
                                           subject=u'title', body=u'hi there3',
 
                                    recipients=[self.u3, self.u1, self.u2])
 
        Session().commit()
 

	
 
        self.assertEqual(NotificationModel()
 
                         .get_unread_cnt_for_user(self.u1), 2)
 
        self.assertEqual(NotificationModel()
 
                         .get_unread_cnt_for_user(self.u2), 1)
 
        self.assertEqual(NotificationModel()
 
                         .get_unread_cnt_for_user(self.u3), 2)
 

	
 

	
 

	
 

	
rhodecode/tests/models/test_repos_groups.py
Show inline comments
 
@@ -146,25 +146,25 @@ class TestReposGroups(unittest.TestCase)
 

	
 
        self.__update_group(g1.group_id, 'g1', parent_id=g2.group_id)
 
        self.assertTrue(self.__check_path('g2', 'g1'))
 

	
 
        # test repo
 
        self.assertEqual(r.repo_name, RepoGroup.url_sep().join(['g2', 'g1',
 
                                                                r.just_name]))
 

	
 
    def test_move_to_root(self):
 
        g1 = _make_group('t11')
 
        Session().commit()
 
        g2 = _make_group('t22', parent_id=g1.group_id)
 
        Session().commit()
 

	
 
        self.assertEqual(g2.full_path, 't11/t22')
 
        self.assertTrue(self.__check_path('t11', 't22'))
 

	
 
        g2 = self.__update_group(g2.group_id, 'g22', parent_id=None)
 
        Session().commit()
 

	
 
        self.assertEqual(g2.group_name, 'g22')
 
        # we moved out group from t1 to '' so it's full path should be 'g2'
 
        self.assertEqual(g2.full_path, 'g22')
 
        self.assertFalse(self.__check_path('t11', 't22'))
 
        self.assertTrue(self.__check_path('g22'))
 
\ No newline at end of file
 
        self.assertTrue(self.__check_path('g22'))
0 comments (0 inline, 0 general)