##// END OF EJS Templates
cleanup: use example.com for tests and examples...
Søren Løvborg -
r5497:12b47803 stable
parent child Browse files
Show More
@@ -57,7 +57,7 b' pdebug = false'
57 57 ## SMTP server settings
58 58 ## Only smtp_server is mandatory. All other settings take the specified default
59 59 ## values.
60 #smtp_server = mail.server.com
60 #smtp_server = smtp.example.com
61 61 #smtp_username =
62 62 #smtp_password =
63 63 #smtp_port = 25
@@ -228,8 +228,8 b' show_revision_number = false'
228 228
229 229 ## gist URL alias, used to create nicer urls for gist. This should be an
230 230 ## url that does rewrites to _admin/gists/<gistid>.
231 ## example: http://gist.kallithea.server/{gistid}. Empty means use the internal
232 ## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/<gistid>
231 ## example: http://gist.example.com/{gistid}. Empty means use the internal
232 ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid>
233 233 gist_alias_url =
234 234
235 235 ## white list of API enabled controllers. This allows to add list of
@@ -264,7 +264,7 b' issue_pat = (?:\\s*#)(\\d+)'
264 264 ## fetched from the regex and {repo} is replaced with full repository name
265 265 ## including groups {repo_name} is replaced with just name of repo
266 266
267 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
267 issue_server_link = https://issues.example.com/{repo}/issue/{id}
268 268
269 269 ## prefix to add to link to indicate it's an url
270 270 ## #314 will be replaced by <issue_prefix><id>
@@ -274,10 +274,10 b' issue_prefix = #'
274 274 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
275 275 ## multiple patterns, to other issues server, wiki or others
276 276 ## below an example how to create a wiki pattern
277 # wiki-some-id -> https://mywiki.com/some-id
277 # wiki-some-id -> https://wiki.example.com/some-id
278 278
279 279 #issue_pat_wiki = (?:wiki-)(.+)
280 #issue_server_link_wiki = https://mywiki.com/{id}
280 #issue_server_link_wiki = https://wiki.example.com/{id}
281 281 #issue_prefix_wiki = WIKI-
282 282
283 283 ## instance-id prefix
@@ -49,7 +49,7 b' Clients must send JSON encoded JSON-RPC '
49 49
50 50 For example, to pull to a local "CPython" mirror using curl::
51 51
52 curl https://example.com/_admin/api -X POST -H 'content-type:text/plain' \
52 curl https://kallithea.example.com/_admin/api -X POST -H 'content-type:text/plain' \
53 53 --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}'
54 54
55 55 In general, provide
@@ -36,7 +36,7 b' up for you.'
36 36 The ``setup-db`` values can also be given on the command line.
37 37 Example::
38 38
39 paster setup-db my.ini --user=nn --password=secret --email=nn@example.org --repos=/srv/repos
39 paster setup-db my.ini --user=nn --password=secret --email=nn@example.com --repos=/srv/repos
40 40
41 41 The ``setup-db`` command will create all needed tables and an
42 42 admin account. When choosing a root path you can either use a new
@@ -108,7 +108,7 b' If your main directory (the same as set '
108 108 example set to ``/srv/repos`` and the repository you are using is
109 109 named ``kallithea``, then to clone via ssh you should run::
110 110
111 hg clone ssh://user@server.com//srv/repos/kallithea
111 hg clone ssh://user@kallithea.example.com/srv/repos/kallithea
112 112
113 113 Using other external tools such as mercurial-server_ or using ssh key-based
114 114 authentication is fully supported.
@@ -176,7 +176,7 b" Here's a typical LDAP setup::"
176 176
177 177 Connection settings
178 178 Enable LDAP = checked
179 Host = host.example.org
179 Host = host.example.com
180 180 Port = 389
181 181 Account = <account>
182 182 Password = <password>
@@ -443,7 +443,7 b' and have that replaced with a URL to the'
443 443 uncomment the following variables in the ini file::
444 444
445 445 issue_pat = (?:^#|\s#)(\w+)
446 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
446 issue_server_link = https://issues.example.com/{repo}/issue/{id}
447 447 issue_prefix = #
448 448
449 449 ``issue_pat`` is the regular expression describing which strings in
@@ -461,13 +461,13 b' generate a URL in the format:'
461 461
462 462 .. code-block:: html
463 463
464 <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>
464 <a href="https://issues.example.com/example_repo/issue/300">ISSUE-300</a>
465 465
466 466 If needed, more than one pattern can be specified by appending a unique suffix to
467 467 the variables. For example::
468 468
469 469 issue_pat_wiki = (?:wiki-)(.+)
470 issue_server_link_wiki = https://mywiki.com/{id}
470 issue_server_link_wiki = https://wiki.example.com/{id}
471 471 issue_prefix_wiki = WIKI-
472 472
473 473 With these settings, wiki pages can be referenced as wiki-some-id, and every
@@ -475,7 +475,7 b' such reference will be transformed into:'
475 475
476 476 .. code-block:: html
477 477
478 <a href="https://mywiki.com/some-id">WIKI-some-id</a>
478 <a href="https://wiki.example.com/some-id">WIKI-some-id</a>
479 479
480 480
481 481 Hook management
@@ -569,7 +569,7 b' Sample config for Nginx using proxy:'
569 569 ## gist alias
570 570 server {
571 571 listen 443;
572 server_name gist.myserver.com;
572 server_name gist.example.com;
573 573 access_log /var/log/nginx/gist.access.log;
574 574 error_log /var/log/nginx/gist.error.log;
575 575
@@ -583,13 +583,13 b' Sample config for Nginx using proxy:'
583 583 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
584 584 ssl_prefer_server_ciphers on;
585 585
586 rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1;
587 rewrite (.*) https://your.kallithea.server/_admin/gists;
586 rewrite ^/(.+)$ https://kallithea.example.com/_admin/gists/$1;
587 rewrite (.*) https://kallithea.example.com/_admin/gists;
588 588 }
589 589
590 590 server {
591 591 listen 443;
592 server_name your.kallithea.server;
592 server_name kallithea.example.com
593 593 access_log /var/log/nginx/kallithea.access.log;
594 594 error_log /var/log/nginx/kallithea.error.log;
595 595
@@ -648,7 +648,7 b' Here is a sample configuration file for '
648 648 .. code-block:: apache
649 649
650 650 <VirtualHost *:80>
651 ServerName hg.myserver.com
651 ServerName kallithea.example.com
652 652
653 653 <Proxy *>
654 654 # For Apache 2.4 and later:
@@ -78,11 +78,11 b' Permanent repository URLs'
78 78 Due to the complicated nature of repository grouping, URLs of repositories
79 79 can often change. For example, a repository originally accessible from::
80 80
81 http://example.com/repo_name
81 http://kallithea.example.com/repo_name
82 82
83 83 would get a new URL after moving it to test_group::
84 84
85 http://example.com/test_group/repo_name
85 http://kallithea.example.com/test_group/repo_name
86 86
87 87 Such moving of a repository to a group can be an issue for build systems and
88 88 other scripts where the repository paths are hardcoded. To mitigate this,
@@ -94,7 +94,7 b' such URLs.'
94 94
95 95 In the example, the repository could also be accessible as::
96 96
97 http://example.com/_<ID>
97 http://kallithea.example.com/_<ID>
98 98
99 99 The ID of a given repository can be shown from the repository ``Summary`` page,
100 100 by selecting the ``Show by ID`` button next to ``Clone URL``.
@@ -137,7 +137,7 b' Currently it supports the following opti'
137 137
138 138 If you need to clone repositories that are protected via basic authentication,
139 139 you can pass the credentials in the URL, e.g.
140 ``http://user:passw@remote.server/repo``. Kallithea will then try to login and
140 ``http://user:passw@remote.example.com/repo``. Kallithea will then try to login and
141 141 clone using the given credentials. Please note that the given credentials will
142 142 be stored as plaintext inside the database. However, the authentication
143 143 information will not be shown in the clone URL on the summary page.
@@ -36,7 +36,7 b' def argparser(argv):'
36 36 "kallithea-api [-h] [--format=FORMAT] [--apikey=APIKEY] [--apihost=APIHOST] "
37 37 "[--config=CONFIG] [--save-config] "
38 38 "METHOD <key:val> <key2:val> ...\n"
39 "Create config file: kallithea-api --apikey=<key> --apihost=http://your.kallithea.server --save-config"
39 "Create config file: kallithea-api --apikey=<key> --apihost=http://kallithea.example.com --save-config"
40 40 )
41 41
42 42 parser = argparse.ArgumentParser(description='Kallithea API cli',
@@ -39,7 +39,7 b' def argparser(argv):'
39 39 "kallithea-gist [-h] [--format=FORMAT] [--apikey=APIKEY] [--apihost=APIHOST] "
40 40 "[--config=CONFIG] [--save-config] [GIST OPTIONS] "
41 41 "[filename or stdin use - for terminal stdin ]\n"
42 "Create config file: kallithea-gist --apikey=<key> --apihost=http://your.kallithea.server --save-config"
42 "Create config file: kallithea-gist --apikey=<key> --apihost=http://kallithea.example.com --save-config"
43 43 )
44 44
45 45 parser = argparse.ArgumentParser(description='Kallithea Gist cli',
@@ -1,11 +1,11 b''
1 1 [default]
2 api_url = http://your.kallithea.server:5000/_admin/api
2 api_url = http://kallithea.example.com/_admin/api
3 3 api_user = admin
4 4 api_key = XXXXXXXXXXXX
5 5
6 ldap_uri = ldap://your.ldap.server:389
7 ldap_user = cn=kallithea,ou=binders,dc=linaro,dc=org
6 ldap_uri = ldap://ldap.example.com:389
7 ldap_user = cn=kallithea,dc=example,dc=com
8 8 ldap_key = XXXXXXXXX
9 base_dn = dc=linaro,dc=org
9 base_dn = dc=example,dc=com
10 10
11 11 sync_users = True No newline at end of file
@@ -51,7 +51,7 b' pdebug = false'
51 51 <%text>## SMTP server settings</%text>
52 52 <%text>## Only smtp_server is mandatory. All other settings take the specified default</%text>
53 53 <%text>## values.</%text>
54 #smtp_server = mail.server.com
54 #smtp_server = smtp.example.com
55 55 #smtp_username =
56 56 #smtp_password =
57 57 #smtp_port = 25
@@ -226,8 +226,8 b' show_revision_number = false'
226 226
227 227 <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text>
228 228 <%text>## url that does rewrites to _admin/gists/<gistid>.</%text>
229 <%text>## example: http://gist.kallithea.server/{gistid}. Empty means use the internal</%text>
230 <%text>## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/<gistid></%text>
229 <%text>## example: http://gist.example.com/{gistid}. Empty means use the internal</%text>
230 <%text>## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid></%text>
231 231 gist_alias_url =
232 232
233 233 <%text>## white list of API enabled controllers. This allows to add list of</%text>
@@ -262,7 +262,7 b' issue_pat = (?:\\s*#)(\\d+)'
262 262 <%text>## fetched from the regex and {repo} is replaced with full repository name</%text>
263 263 <%text>## including groups {repo_name} is replaced with just name of repo</%text>
264 264
265 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
265 issue_server_link = https://issues.example.com/{repo}/issue/{id}
266 266
267 267 <%text>## prefix to add to link to indicate it's an url</%text>
268 268 <%text>## #314 will be replaced by <issue_prefix><id></%text>
@@ -272,10 +272,10 b' issue_prefix = #'
272 272 <%text>## issue_pat, issue_server_link, issue_prefix can have suffixes to specify</%text>
273 273 <%text>## multiple patterns, to other issues server, wiki or others</%text>
274 274 <%text>## below an example how to create a wiki pattern</%text>
275 # wiki-some-id -> https://mywiki.com/some-id
275 # wiki-some-id -> https://wiki.example.com/some-id
276 276
277 277 #issue_pat_wiki = (?:wiki-)(.+)
278 #issue_server_link_wiki = https://mywiki.com/{id}
278 #issue_server_link_wiki = https://wiki.example.com/{id}
279 279 #issue_prefix_wiki = WIKI-
280 280
281 281 <%text>## instance-id prefix</%text>
@@ -52,7 +52,7 b' pdebug = false'
52 52 ## SMTP server settings
53 53 ## Only smtp_server is mandatory. All other settings take the specified default
54 54 ## values.
55 #smtp_server = mail.server.com
55 #smtp_server = smtp.example.com
56 56 #smtp_username =
57 57 #smtp_password =
58 58 #smtp_port = 25
@@ -222,8 +222,8 b' show_revision_number = false'
222 222
223 223 ## gist URL alias, used to create nicer urls for gist. This should be an
224 224 ## url that does rewrites to _admin/gists/<gistid>.
225 ## example: http://gist.kallithea.server/{gistid}. Empty means use the internal
226 ## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/<gistid>
225 ## example: http://gist.example.com/{gistid}. Empty means use the internal
226 ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid>
227 227 gist_alias_url =
228 228
229 229 ## white list of API enabled controllers. This allows to add list of
@@ -258,7 +258,7 b' issue_pat = (?:\\s*#)(\\d+)'
258 258 ## fetched from the regex and {repo} is replaced with full repository name
259 259 ## including groups {repo_name} is replaced with just name of repo
260 260
261 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
261 issue_server_link = https://issues.example.com/{repo}/issue/{id}
262 262
263 263 ## prefix to add to link to indicate it's an url
264 264 ## #314 will be replaced by <issue_prefix><id>
@@ -268,10 +268,10 b' issue_prefix = #'
268 268 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
269 269 ## multiple patterns, to other issues server, wiki or others
270 270 ## below an example how to create a wiki pattern
271 # wiki-some-id -> https://mywiki.com/some-id
271 # wiki-some-id -> https://wiki.example.com/some-id
272 272
273 273 #issue_pat_wiki = (?:wiki-)(.+)
274 #issue_server_link_wiki = https://mywiki.com/{id}
274 #issue_server_link_wiki = https://wiki.example.com/{id}
275 275 #issue_prefix_wiki = WIKI-
276 276
277 277 ## instance-id prefix
@@ -138,7 +138,7 b' class MailResponse(object):'
138 138 as __init__ parameters, or by setting those attributes.
139 139
140 140 You can initially set the From, To, and Subject, but they are headers so
141 use the dict notation to change them: msg['From'] = 'joe@test.com'.
141 use the dict notation to change them: msg['From'] = 'joe@example.com'.
142 142
143 143 The message is not fully crafted until right when you convert it with
144 144 MailResponse.to_message. This lets you change it and work with it, then
@@ -90,15 +90,15 b' environ = {}'
90 90 TESTS_TMP_PATH = jn('/', 'tmp', 'rc_test_%s' % _RandomNameSequence().next())
91 91 TEST_USER_ADMIN_LOGIN = 'test_admin'
92 92 TEST_USER_ADMIN_PASS = 'test12'
93 TEST_USER_ADMIN_EMAIL = 'test_admin@mail.com'
93 TEST_USER_ADMIN_EMAIL = 'test_admin@example.com'
94 94
95 95 TEST_USER_REGULAR_LOGIN = 'test_regular'
96 96 TEST_USER_REGULAR_PASS = 'test12'
97 TEST_USER_REGULAR_EMAIL = 'test_regular@mail.com'
97 TEST_USER_REGULAR_EMAIL = 'test_regular@example.com'
98 98
99 99 TEST_USER_REGULAR2_LOGIN = 'test_regular2'
100 100 TEST_USER_REGULAR2_PASS = 'test12'
101 TEST_USER_REGULAR2_EMAIL = 'test_regular2@mail.com'
101 TEST_USER_REGULAR2_EMAIL = 'test_regular2@example.com'
102 102
103 103 HG_REPO = 'vcs_test_hg'
104 104 GIT_REPO = 'vcs_test_git'
@@ -552,7 +552,7 b' class _BaseTestApi(object):'
552 552 def test_api_create_existing_user(self):
553 553 id_, params = _build_data(self.apikey, 'create_user',
554 554 username=TEST_USER_ADMIN_LOGIN,
555 email='test@foo.com',
555 email='test@example.com',
556 556 password='trololo')
557 557 response = api_call(self, params)
558 558
@@ -571,7 +571,7 b' class _BaseTestApi(object):'
571 571
572 572 def test_api_create_user(self):
573 573 username = 'test_new_api_user'
574 email = username + "@foo.com"
574 email = username + "@example.com"
575 575
576 576 id_, params = _build_data(self.apikey, 'create_user',
577 577 username=username,
@@ -593,7 +593,7 b' class _BaseTestApi(object):'
593 593
594 594 def test_api_create_user_without_password(self):
595 595 username = 'test_new_api_user_passwordless'
596 email = username + "@foo.com"
596 email = username + "@example.com"
597 597
598 598 id_, params = _build_data(self.apikey, 'create_user',
599 599 username=username,
@@ -613,7 +613,7 b' class _BaseTestApi(object):'
613 613
614 614 def test_api_create_user_with_extern_name(self):
615 615 username = 'test_new_api_user_passwordless'
616 email = username + "@foo.com"
616 email = username + "@example.com"
617 617
618 618 id_, params = _build_data(self.apikey, 'create_user',
619 619 username=username,
@@ -635,7 +635,7 b' class _BaseTestApi(object):'
635 635 def test_api_create_user_when_exception_happened(self):
636 636
637 637 username = 'test_new_api_user'
638 email = username + "@foo.com"
638 email = username + "@example.com"
639 639
640 640 id_, params = _build_data(self.apikey, 'create_user',
641 641 username=username,
@@ -1138,7 +1138,7 b' class _BaseTestApi(object):'
1138 1138 ('description', {'description': 'new description'}),
1139 1139 ('active', {'active': True}),
1140 1140 ('active', {'active': False}),
1141 ('clone_uri', {'clone_uri': 'http://foo.com/repo'}),
1141 ('clone_uri', {'clone_uri': 'http://example.com/repo'}),
1142 1142 ('clone_uri', {'clone_uri': None}),
1143 1143 ('landing_rev', {'landing_rev': 'branch:master'}),
1144 1144 ('enable_statistics', {'enable_statistics': True}),
@@ -47,7 +47,7 b' class TestAdminUsersController(TestContr'
47 47 password_confirmation = password
48 48 name = 'name'
49 49 lastname = 'lastname'
50 email = 'mail@mail.com'
50 email = 'mail@example.com'
51 51
52 52 response = self.app.post(url('users'),
53 53 {'username': username,
@@ -83,7 +83,7 b' class TestAdminUsersController(TestContr'
83 83 password = ''
84 84 name = 'name'
85 85 lastname = 'lastname'
86 email = 'errmail.com'
86 email = 'errmail.example.com'
87 87
88 88 response = self.app.post(url('users'), {'username': username,
89 89 'password': password,
@@ -119,7 +119,7 b' class TestAdminUsersController(TestContr'
119 119 ('extern_name', {'extern_name': None}),
120 120 ('active', {'active': False}),
121 121 ('active', {'active': True}),
122 ('email', {'email': 'some@email.com'}),
122 ('email', {'email': 'someemail@example.com'}),
123 123 # ('new_password', {'new_password': 'foobar123',
124 124 # 'password_confirmation': 'foobar123'})
125 125 ])
@@ -97,7 +97,7 b' class TestFilesController(TestController'
97 97 revision='8911406ad776fdd3d0b9932a2e89677e57405a48',
98 98 f_path='vcs/nodes.py'))
99 99
100 response.mustcontain("""<div class="commit">Partially implemented <a class="issue-tracker-link" href="https://myissueserver.com/vcs_test_hg/issue/16">#16</a>. filecontent/commit message/author/node name are safe_unicode now.
100 response.mustcontain("""<div class="commit">Partially implemented <a class="issue-tracker-link" href="https://issues.example.com/vcs_test_hg/issue/16">#16</a>. filecontent/commit message/author/node name are safe_unicode now.
101 101 In addition some other __str__ are unicode as well
102 102 Added test for unicode
103 103 Improved test to clone into uniq repository.
@@ -103,8 +103,8 b' class TestLoginController(TestController'
103 103 ('data:text/html,<script>window.alert("xss")</script>',),
104 104 ('mailto:test@example.com',),
105 105 ('file:///etc/passwd',),
106 ('ftp://some.ftp.server',),
107 ('http://other.domain/bl%C3%A5b%C3%A6rgr%C3%B8d',),
106 ('ftp://ftp.example.com',),
107 ('http://other.example.com/bl%C3%A5b%C3%A6rgr%C3%B8d',),
108 108 ])
109 109 def test_login_bad_came_froms(self, url_came_from):
110 110 response = self.app.post(url(controller='login', action='index',
@@ -205,7 +205,7 b' class TestLoginController(TestController'
205 205 {'username': uname,
206 206 'password': 'test12',
207 207 'password_confirmation': 'test12',
208 'email': 'goodmail@domain.com',
208 'email': 'goodmail@example.com',
209 209 'firstname': 'test',
210 210 'lastname': 'test'})
211 211
@@ -304,7 +304,7 b' class TestLoginController(TestController'
304 304 def test_register_ok(self):
305 305 username = 'test_regular4'
306 306 password = 'qweqwe'
307 email = 'username@test.com'
307 email = 'user4@example.com'
308 308 name = 'testname'
309 309 lastname = 'testlastname'
310 310
@@ -348,7 +348,7 b' class TestLoginController(TestController'
348 348
349 349 username = 'test_password_reset_1'
350 350 password = 'qweqwe'
351 email = 'username@python-works.com'
351 email = 'username@example.com'
352 352 name = 'passwd'
353 353 lastname = 'reset'
354 354 timestamp = int(time.time())
@@ -67,16 +67,16 b' class TestMyAccountController(TestContro'
67 67 response.mustcontain('No additional emails specified')
68 68
69 69 response = self.app.post(url('my_account_emails'),
70 {'new_email': 'foo@barz.com', '_authentication_token': self.authentication_token()})
70 {'new_email': 'barz@example.com', '_authentication_token': self.authentication_token()})
71 71
72 72 response = self.app.get(url('my_account_emails'))
73 73
74 74 from kallithea.model.db import UserEmailMap
75 75 email_id = UserEmailMap.query()\
76 76 .filter(UserEmailMap.user == User.get_by_username(TEST_USER_ADMIN_LOGIN))\
77 .filter(UserEmailMap.email == 'foo@barz.com').one().email_id
77 .filter(UserEmailMap.email == 'barz@example.com').one().email_id
78 78
79 response.mustcontain('foo@barz.com')
79 response.mustcontain('barz@example.com')
80 80 response.mustcontain('<input id="del_email_id" name="del_email_id" type="hidden" value="%s" />' % email_id)
81 81
82 82 response = self.app.post(url('my_account_emails'),
@@ -97,7 +97,7 b' class TestMyAccountController(TestContro'
97 97 #('extern_name', {'extern_name': None}),
98 98 ('active', {'active': False}),
99 99 ('active', {'active': True}),
100 ('email', {'email': 'some@email.com'}),
100 ('email', {'email': 'someemail@example.com'}),
101 101 # ('new_password', {'new_password': 'foobar123',
102 102 # 'password_confirmation': 'foobar123'})
103 103 ])
@@ -112,13 +112,13 b' def _add_files_and_push(vcs, DEST, **kwa'
112 112 for i in xrange(kwargs.get('files_no', 3)):
113 113 cmd = """echo 'added_line%s' >> %s""" % (i, added_file)
114 114 Command(cwd).execute(cmd)
115 author_str = 'User ǝɯɐᴎ <me@email.com>'
115 author_str = 'User ǝɯɐᴎ <me@example.com>'
116 116 if vcs == 'hg':
117 117 cmd = """hg commit -m 'commited new %s' -u '%s' %s """ % (
118 118 i, author_str, added_file
119 119 )
120 120 elif vcs == 'git':
121 cmd = """EMAIL="me@email.com" git commit -m 'commited new %s' --author '%s' %s """ % (
121 cmd = """EMAIL="me@example.com" git commit -m 'commited new %s' --author '%s' %s """ % (
122 122 i, author_str, added_file
123 123 )
124 124 Command(cwd).execute(cmd)
@@ -42,11 +42,11 b' TEST_URLS = ['
42 42 '%s://127.0.0.1' % proto),
43 43 ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'],
44 44 '%s://127.0.0.1:8080' % proto),
45 ('%s://domain.org' % proto, ['%s://' % proto, 'domain.org'],
46 '%s://domain.org' % proto),
47 ('%s://user:pass@domain.org:8080' % proto, ['%s://' % proto, 'domain.org',
45 ('%s://example.com' % proto, ['%s://' % proto, 'example.com'],
46 '%s://example.com' % proto),
47 ('%s://user:pass@example.com:8080' % proto, ['%s://' % proto, 'example.com',
48 48 '8080'],
49 '%s://domain.org:8080' % proto),
49 '%s://example.com:8080' % proto),
50 50 ]
51 51
52 52 proto = 'https'
@@ -59,11 +59,11 b' TEST_URLS += ['
59 59 '%s://127.0.0.1' % proto),
60 60 ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'],
61 61 '%s://127.0.0.1:8080' % proto),
62 ('%s://domain.org' % proto, ['%s://' % proto, 'domain.org'],
63 '%s://domain.org' % proto),
64 ('%s://user:pass@domain.org:8080' % proto, ['%s://' % proto, 'domain.org',
62 ('%s://example.com' % proto, ['%s://' % proto, 'example.com'],
63 '%s://example.com' % proto),
64 ('%s://user:pass@example.com:8080' % proto, ['%s://' % proto, 'example.com',
65 65 '8080'],
66 '%s://domain.org:8080' % proto),
66 '%s://example.com:8080' % proto),
67 67 ]
68 68
69 69
@@ -104,11 +104,11 b' class TestLibs(BaseTestCase):'
104 104 def test_mention_extractor(self):
105 105 from kallithea.lib.utils2 import extract_mentioned_users
106 106 sample = (
107 "@first hi there @world here's my email username@email.com "
107 "@first hi there @world here's my email username@example.com "
108 108 "@lukaszb check @one_more22 it pls @ ttwelve @D[] @one@two@three "
109 109 "@UPPER @cAmEL @2one_more22 @john please see this http://org.pl "
110 110 "@marian.user just do it @marco-polo and next extract @marco_polo "
111 "user.dot hej ! not-needed maril@domain.org"
111 "user.dot hej ! not-needed maril@example.com"
112 112 )
113 113
114 114 s = sorted([
@@ -184,7 +184,7 b' class TestLibs(BaseTestCase):'
184 184 def test_tag_exctrator(self):
185 185 sample = (
186 186 "hello pta[tag] gog [[]] [[] sda ero[or]d [me =>>< sa]"
187 "[requires] [stale] [see<>=>] [see => http://url.com]"
187 "[requires] [stale] [see<>=>] [see => http://example.com]"
188 188 "[requires => url] [lang => python] [just a tag]"
189 189 "[,d] [ => ULR ] [obsolete] [desc]]"
190 190 )
@@ -205,7 +205,7 b' class TestLibs(BaseTestCase):'
205 205 class fake_url(object):
206 206 @classmethod
207 207 def current(cls, *args, **kwargs):
208 return 'https://server.com'
208 return 'https://example.com'
209 209
210 210 #mock pylons.tmpl_context
211 211 def fake_tmpl_context(_url):
@@ -218,35 +218,35 b' class TestLibs(BaseTestCase):'
218 218
219 219
220 220 with mock.patch('pylons.url', fake_url):
221 fake = fake_tmpl_context(_url='http://test.com/{email}')
221 fake = fake_tmpl_context(_url='http://example.com/{email}')
222 222 with mock.patch('pylons.tmpl_context', fake):
223 223 from pylons import url
224 assert url.current() == 'https://server.com'
225 grav = gravatar_url(email_address='test@foo.com', size=24)
226 assert grav == 'http://test.com/test@foo.com'
224 assert url.current() == 'https://example.com'
225 grav = gravatar_url(email_address='test@example.com', size=24)
226 assert grav == 'http://example.com/test@example.com'
227 227
228 fake = fake_tmpl_context(_url='http://test.com/{email}')
228 fake = fake_tmpl_context(_url='http://example.com/{email}')
229 229 with mock.patch('pylons.tmpl_context', fake):
230 grav = gravatar_url(email_address='test@foo.com', size=24)
231 assert grav == 'http://test.com/test@foo.com'
230 grav = gravatar_url(email_address='test@example.com', size=24)
231 assert grav == 'http://example.com/test@example.com'
232 232
233 fake = fake_tmpl_context(_url='http://test.com/{md5email}')
233 fake = fake_tmpl_context(_url='http://example.com/{md5email}')
234 234 with mock.patch('pylons.tmpl_context', fake):
235 em = 'test@foo.com'
235 em = 'test@example.com'
236 236 grav = gravatar_url(email_address=em, size=24)
237 assert grav == 'http://test.com/%s' % (_md5(em))
237 assert grav == 'http://example.com/%s' % (_md5(em))
238 238
239 fake = fake_tmpl_context(_url='http://test.com/{md5email}/{size}')
239 fake = fake_tmpl_context(_url='http://example.com/{md5email}/{size}')
240 240 with mock.patch('pylons.tmpl_context', fake):
241 em = 'test@foo.com'
241 em = 'test@example.com'
242 242 grav = gravatar_url(email_address=em, size=24)
243 assert grav == 'http://test.com/%s/%s' % (_md5(em), 24)
243 assert grav == 'http://example.com/%s/%s' % (_md5(em), 24)
244 244
245 245 fake = fake_tmpl_context(_url='{scheme}://{netloc}/{md5email}/{size}')
246 246 with mock.patch('pylons.tmpl_context', fake):
247 em = 'test@foo.com'
247 em = 'test@example.com'
248 248 grav = gravatar_url(email_address=em, size=24)
249 assert grav == 'https://server.com/%s/%s' % (_md5(em), 24)
249 assert grav == 'https://example.com/%s/%s' % (_md5(em), 24)
250 250
251 251 @parameterized.expand([
252 252 (Repository.DEFAULT_CLONE_URI, 'group/repo1', {}, '', 'http://vps1:8000/group/repo1'),
@@ -260,9 +260,9 b' class TestLibs(BaseTestCase):'
260 260 ('{scheme}://{user}@{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://username@vps1:8000/_23'),
261 261 ('http://{user}@{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://username@vps1:8000/_23'),
262 262 ('http://{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://vps1:8000/_23'),
263 ('https://{user}@proxy1.server.com/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://username@proxy1.server.com/group/repo1'),
264 ('https://{user}@proxy1.server.com/{repo}', 'group/repo1', {}, '', 'https://proxy1.server.com/group/repo1'),
265 ('https://proxy1.server.com/{user}/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://proxy1.server.com/username/group/repo1'),
263 ('https://{user}@proxy1.example.com/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://username@proxy1.example.com/group/repo1'),
264 ('https://{user}@proxy1.example.com/{repo}', 'group/repo1', {}, '', 'https://proxy1.example.com/group/repo1'),
265 ('https://proxy1.example.com/{user}/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://proxy1.example.com/username/group/repo1'),
266 266 ])
267 267 def test_clone_url_generator(self, tmpl, repo_name, overrides, prefix, expected):
268 268 from kallithea.lib.utils2 import get_clone_url
@@ -337,12 +337,12 b' class TestLibs(BaseTestCase):'
337 337 "from rev a also rev url[http://google.com]",
338 338 "http://google.com"),
339 339 ("""Multi line
340 https://foo.bar.com
340 https://foo.bar.example.com
341 341 some text lalala""",
342 342 """Multi line
343 url[https://foo.bar.com]
343 url[https://foo.bar.example.com]
344 344 some text lalala""",
345 "https://foo.bar.com")
345 "https://foo.bar.example.com")
346 346 ])
347 347 def test_urlify_test(self, sample, expected, url_):
348 348 from kallithea.lib.helpers import urlify_text
@@ -107,7 +107,7 b' def create_test_user(force=True):'
107 107 new_usr = User()
108 108 new_usr.username = USER
109 109 new_usr.password = get_crypt_password(PASS)
110 new_usr.email = 'mail@mail.com'
110 new_usr.email = 'mail@example.com'
111 111 new_usr.name = 'test'
112 112 new_usr.lastname = 'lasttestname'
113 113 new_usr.active = True
@@ -56,7 +56,7 b' pdebug = false'
56 56 ## SMTP server settings
57 57 ## Only smtp_server is mandatory. All other settings take the specified default
58 58 ## values.
59 #smtp_server = mail.server.com
59 #smtp_server = smtp.example.com
60 60 #smtp_username =
61 61 #smtp_password =
62 62 #smtp_port = 25
@@ -228,8 +228,8 b' show_revision_number = true'
228 228
229 229 ## gist URL alias, used to create nicer urls for gist. This should be an
230 230 ## url that does rewrites to _admin/gists/<gistid>.
231 ## example: http://gist.kallithea.server/{gistid}. Empty means use the internal
232 ## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/<gistid>
231 ## example: http://gist.example.com/{gistid}. Empty means use the internal
232 ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid>
233 233 gist_alias_url =
234 234
235 235 ## white list of API enabled controllers. This allows to add list of
@@ -264,7 +264,7 b' issue_pat = (?:\\s*#)(\\d+)'
264 264 ## fetched from the regex and {repo} is replaced with full repository name
265 265 ## including groups {repo_name} is replaced with just name of repo
266 266
267 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
267 issue_server_link = https://issues.example.com/{repo}/issue/{id}
268 268
269 269 ## prefix to add to link to indicate it's an url
270 270 ## #314 will be replaced by <issue_prefix><id>
@@ -274,10 +274,10 b' issue_prefix = #'
274 274 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
275 275 ## multiple patterns, to other issues server, wiki or others
276 276 ## below an example how to create a wiki pattern
277 # wiki-some-id -> https://mywiki.com/some-id
277 # wiki-some-id -> https://wiki.example.com/some-id
278 278
279 279 #issue_pat_wiki = (?:wiki-)(.+)
280 #issue_server_link_wiki = https://mywiki.com/{id}
280 #issue_server_link_wiki = https://wiki.example.com/{id}
281 281 #issue_prefix_wiki = WIKI-
282 282
283 283 ## instance-id prefix
@@ -184,26 +184,26 b' class TestParseDatetime(unittest.TestCas'
184 184
185 185
186 186 class TestAuthorExtractors(unittest.TestCase):
187 TEST_AUTHORS = [("Username Last'o'Name <username@python-works.com>",
188 ("Username Last'o'Name", "username@python-works.com")),
189 ("Username Last'o'Name Spaces < username@python-works.com >",
190 ("Username Last'o'Name Spaces", "username@python-works.com")),
191 ("Username Last'o'Name <username.lastname@python-works.com>",
192 ("Username Last'o'Name", "username.lastname@python-works.com")),
193 ('mrf RFC_SPEC <username+lastname@python-works.com>',
194 ('mrf RFC_SPEC', 'username+lastname@python-works.com')),
195 ('username <user@email.com>',
196 ('username', 'user@email.com')),
197 ('username <user@email.com',
198 ('username', 'user@email.com')),
199 ('broken missing@email.com',
200 ('broken', 'missing@email.com')),
201 ('<justemail@mail.com>',
202 ('', 'justemail@mail.com')),
187 TEST_AUTHORS = [("Username Last'o'Name <username@example.com>",
188 ("Username Last'o'Name", "username@example.com")),
189 ("Username Last'o'Name Spaces < username@example.com >",
190 ("Username Last'o'Name Spaces", "username@example.com")),
191 ("Username Last'o'Name <username.lastname@example.com>",
192 ("Username Last'o'Name", "username.lastname@example.com")),
193 ('mrf RFC_SPEC <username+lastname@example.com>',
194 ('mrf RFC_SPEC', 'username+lastname@example.com')),
195 ('username <user@example.com>',
196 ('username', 'user@example.com')),
197 ('username <user@example.com',
198 ('username', 'user@example.com')),
199 ('broken missing@example.com',
200 ('broken', 'missing@example.com')),
201 ('<justemail@example.com>',
202 ('', 'justemail@example.com')),
203 203 ('justname',
204 204 ('justname', '')),
205 ('Mr Double Name withemail@email.com ',
206 ('Mr Double Name', 'withemail@email.com')),
205 ('Mr Double Name withemail@example.com ',
206 ('Mr Double Name', 'withemail@example.com')),
207 207 ]
208 208
209 209 def test_author_email(self):
General Comments 0
You need to be logged in to leave comments. Login now