##// END OF EJS Templates
lint: ruff run
super-admin -
r5089:fed0c169 default
parent child Browse files
Show More
@@ -180,7 +180,7 b' class TestCreateUser(object):'
180
180
181 personal_group = RepoGroup.get_by_group_name(username)
181 personal_group = RepoGroup.get_by_group_name(username)
182 assert personal_group
182 assert personal_group
183 assert personal_group.personal == True
183 assert personal_group.personal is True
184 assert personal_group.user.username == username
184 assert personal_group.user.username == username
185
185
186 try:
186 try:
@@ -191,7 +191,7 b' class TestUserGroupsView(TestController)'
191
191
192 assert user_group.users_group_name == new_name
192 assert user_group.users_group_name == new_name
193 assert user_group.user_group_description == 'DESC'
193 assert user_group.user_group_description == 'DESC'
194 assert user_group.users_group_active == False
194 assert user_group.users_group_active is False
195
195
196 def test_update_user_group_name_conflicts(self, user_util):
196 def test_update_user_group_name_conflicts(self, user_util):
197 self.log_user()
197 self.log_user()
@@ -112,7 +112,7 b' class CrowdServer(object):'
112 passwd="some_passwd",
112 passwd="some_passwd",
113 version="1")
113 version="1")
114 """
114 """
115 if not "port" in kwargs:
115 if 'port' not in kwargs:
116 kwargs["port"] = "8095"
116 kwargs["port"] = "8095"
117 self._logger = kwargs.get("logger", logging.getLogger(__name__))
117 self._logger = kwargs.get("logger", logging.getLogger(__name__))
118 self._uri = "%s://%s:%s/crowd" % (kwargs.get("method", "http"),
118 self._uri = "%s://%s:%s/crowd" % (kwargs.get("method", "http"),
@@ -105,7 +105,7 b' class Collection(pathed.Pathed):'
105 return max([VerNum(0)] + list(self.versions.keys()))
105 return max([VerNum(0)] + list(self.versions.keys()))
106
106
107 def _next_ver_num(self, use_timestamp_numbering):
107 def _next_ver_num(self, use_timestamp_numbering):
108 if use_timestamp_numbering == True:
108 if use_timestamp_numbering is True:
109 return VerNum(int(datetime.utcnow().strftime('%Y%m%d%H%M%S')))
109 return VerNum(int(datetime.utcnow().strftime('%Y%m%d%H%M%S')))
110 else:
110 else:
111 return self.latest + 1
111 return self.latest + 1
@@ -1,4 +1,3 b''
1
2 # Copyright (C) 2010-2023 RhodeCode GmbH
1 # Copyright (C) 2010-2023 RhodeCode GmbH
3 #
2 #
4 # This program is free software: you can redistribute it and/or modify
3 # This program is free software: you can redistribute it and/or modify
@@ -182,5 +181,5 b' class ColorFormatterSql(logging.Formatte'
182 colored_record = ''.join([start, def_record, end])
181 colored_record = ''.join([start, def_record, end])
183 return colored_record
182 return colored_record
184
183
185 # marcink: needs to stay with this name for backward .ini compatability
184 # NOTE (marcink): needs to stay with this name for backward .ini compatability
186 Pyro4AwareFormatter = ExceptionAwareFormatter
185 Pyro4AwareFormatter = ExceptionAwareFormatter # noqa
@@ -112,8 +112,8 b' class UrlizePattern(markdown.inlinepatte'
112
112
113 text = url
113 text = url
114
114
115 if not url.split('://')[0] in ('http','https','ftp'):
115 if url.split('://')[0] not in ('http', 'https', 'ftp'):
116 if '@' in url and not '/' in url:
116 if '@' in url and '/' not in url:
117 url = 'mailto:' + url
117 url = 'mailto:' + url
118 else:
118 else:
119 url = 'http://' + url
119 url = 'http://' + url
@@ -75,7 +75,7 b' class TestGetUserGroups(object):'
75 groups = UserGroupModel().get_user_groups()
75 groups = UserGroupModel().get_user_groups()
76 expected = ('id', 'icon_link', 'value_display', 'value', 'value_type')
76 expected = ('id', 'icon_link', 'value_display', 'value', 'value_type')
77 for group in groups:
77 for group in groups:
78 assert group['value_type'] is 'user_group'
78 assert group['value_type'] == 'user_group'
79 for key in expected:
79 for key in expected:
80 assert key in group
80 assert key in group
81
81
@@ -50,7 +50,7 b' class TestGetUsers(object):'
50 'id', 'first_name', 'last_name', 'username', 'icon_link',
50 'id', 'first_name', 'last_name', 'username', 'icon_link',
51 'value_display', 'value', 'value_type')
51 'value_display', 'value', 'value_type')
52 for user in users:
52 for user in users:
53 assert user['value_type'] is 'user'
53 assert user['value_type'] == 'user'
54 for key in expected_keys:
54 for key in expected_keys:
55 assert key in user
55 assert key in user
56
56
@@ -164,7 +164,7 b' def test_ValidRepoGroup_edit_group_no_ro'
164 def test_ValidPassword(localizer):
164 def test_ValidPassword(localizer):
165 validator = v.ValidPassword(localizer)
165 validator = v.ValidPassword(localizer)
166 assert 'lol' == validator.to_python('lol')
166 assert 'lol' == validator.to_python('lol')
167 assert None == validator.to_python(None)
167 assert None is validator.to_python(None)
168 pytest.raises(formencode.Invalid, validator.to_python, 'ąćżź')
168 pytest.raises(formencode.Invalid, validator.to_python, 'ąćżź')
169
169
170
170
General Comments 0
You need to be logged in to leave comments. Login now