Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
747cd46
py3: fix except
ThomasWaldmann Jul 12, 2019
aaf4199
py3: idioms
ThomasWaldmann Jul 12, 2019
756c927
py3: long
ThomasWaldmann Jul 12, 2019
094bdc1
py3: methodattrs
ThomasWaldmann Jul 12, 2019
7e4234f
py3: numliterals
ThomasWaldmann Jul 12, 2019
41a34cd
py3: reduce
ThomasWaldmann Jul 12, 2019
9651137
py3: set_literal
ThomasWaldmann Jul 12, 2019
9915b8e
py3: StandardError -> ValueError
ThomasWaldmann Jul 12, 2019
cc07ddd
py3: types
ThomasWaldmann Jul 12, 2019
3585491
py3: classic_division
ThomasWaldmann Jul 12, 2019
b895560
py3: file
ThomasWaldmann Jul 12, 2019
3f8248e
py3: filter
ThomasWaldmann Jul 12, 2019
cb29e9f
py3: imports
ThomasWaldmann Jul 12, 2019
d35214a
py3: next
ThomasWaldmann Jul 12, 2019
767326c
py3: metaclass
ThomasWaldmann Jul 12, 2019
4258fe0
py3: unichr
ThomasWaldmann Jul 13, 2019
c033b29
py3: urllib
ThomasWaldmann Jul 13, 2019
b022419
py3: xrange
ThomasWaldmann Jul 13, 2019
760a8f4
py3: dict
ThomasWaldmann Jul 13, 2019
a311d9c
py3: basestring
ThomasWaldmann Jul 13, 2019
cd5d65e
py3: nonzero
ThomasWaldmann Jul 13, 2019
62110f8
py3: print
ThomasWaldmann Jul 13, 2019
c220fd8
py3: unicode / str
ThomasWaldmann Jul 18, 2019
7b4a2f3
py3: test on py3 (tox and travis-ci)
ThomasWaldmann Jul 13, 2019
a633c38
py3: adapt setup.py / pypi metadata
ThomasWaldmann Jul 13, 2019
69ad03d
py3: use pdfminer3 and new flask-theme for py3 compatibility
ThomasWaldmann Jul 13, 2019
f93ee41
py3: fix unicode in scripts
ThomasWaldmann Jul 13, 2019
738e760
py3: docs, scripts: python s/2.7/3.5/
ThomasWaldmann Jul 19, 2019
f29aebc
py3: fix logging
ThomasWaldmann Jul 13, 2019
f036513
py3: cmp is gone in py3
ThomasWaldmann Jul 13, 2019
13f41c9
py3: buffer is gone in py3
ThomasWaldmann Jul 13, 2019
2b65453
py3: unicode (esp. __unicode__ -> __str__)
ThomasWaldmann Jul 14, 2019
094de1b
py3: Type objects internally use '' instead of None for __lt__
ThomasWaldmann Jul 14, 2019
0dc405a
py3: fix various pep8 errors
erdnaxe Jul 15, 2019
3816c43
py3: classname(object)
ThomasWaldmann Jul 15, 2019
5627c41
py3: NoneType is gone in py3 types
ThomasWaldmann Jul 15, 2019
465cd61
py3: UserDict.DictMixin
ThomasWaldmann Jul 15, 2019
b476177
py3: pysupport.getPackageModules: remove broken support for zipped pkgs
ThomasWaldmann Jul 15, 2019
c4b8577
py3: decode config values if bytes are encountered
ThomasWaldmann Jul 15, 2019
6244b9a
py3: storage.middleware.routing.Backend: "implement" missing method
ThomasWaldmann Jul 15, 2019
9ceb335
py3: adler32 needs bytes object
ThomasWaldmann Jul 15, 2019
1a6a0c1
py3: hmac.new needs bytes objects
ThomasWaldmann Jul 19, 2019
f38a4cb
py3: paramparser + test fixes
ThomasWaldmann Jul 15, 2019
93f9b07
py3: fix test_mime for None -> '' change
ThomasWaldmann Jul 15, 2019
3b3dad1
py3: fix store content type (bytes, not str)
ThomasWaldmann Jul 15, 2019
26425c5
py3: fix sqlite store
ThomasWaldmann Jul 15, 2019
2ecf45a
py3: fix fileserver backend tests
ThomasWaldmann Jul 15, 2019
5f416d1
py3: fix security tests
ThomasWaldmann Jul 15, 2019
2fe48b9
py3: fix auth modules
ThomasWaldmann Jul 15, 2019
dc45293
py3: fix thread monitor
ThomasWaldmann Jul 15, 2019
07ec995
py3: fix apps pkg tests
ThomasWaldmann Jul 15, 2019
f205003
py3: fix utils.notifications
ThomasWaldmann Jul 15, 2019
46947e3
py3: fix wikiutil
ThomasWaldmann Jul 15, 2019
05667c8
py3: rewrite SMTP sendmail with modern EmailMessage stdlib code
ThomasWaldmann Jul 17, 2019
eec75b9
py3: fix anchors related code / tests
ThomasWaldmann Jul 17, 2019
42dcdd5
py3: catch unexpected OSError in timestamp validation code
ThomasWaldmann Jul 17, 2019
a7e577c
py3: iri code/test fixes, str (char) vs. bytes (int)
ThomasWaldmann Jul 17, 2019
502d74b
py3: fix some badly converted isinstance() calls
ThomasWaldmann Jul 17, 2019
a6cf8af
py3: middleware: bytes vs str fixes
ThomasWaldmann Jul 17, 2019
40aa187
py3: serialization: fix eof detection
ThomasWaldmann Jul 17, 2019
4d071dc
py3: items str/bytes fixes, disabled troublesome handle_variables call
ThomasWaldmann Jul 17, 2019
bfbecee
py3: quickinstall.py
RogerHaase Jul 18, 2019
3d7a7e3
py3: some improvements for tarfile handling
ThomasWaldmann Jul 18, 2019
322dde1
py3: fix test_Item test (remove superfluous blank)
ThomasWaldmann Jul 19, 2019
0df1e63
py3: decode whoosh lexicon() call results, bytes -> str
ThomasWaldmann Jul 19, 2019
3cdbbf7
py3: backslashreplace / unicode-escape, encode / decode, str -> str
ThomasWaldmann Jul 19, 2019
011c5f5
py3: moinwiki19_in / freelink_page: remove unneeded .encode()
ThomasWaldmann Jul 19, 2019
ef12fc4
py3: fix text_csv_in converter, csv module now can do unicode
ThomasWaldmann Jul 19, 2019
0374483
py3: fix text_moinwiki_in: attribute order changed, still valid
ThomasWaldmann Jul 19, 2019
8e5e69f
py3: test_link: convert Iri to str first before comparing to str
ThomasWaldmann Jul 19, 2019
7370f96
py3: hr conversion: can't compare str and None
ThomasWaldmann Jul 19, 2019
dc872ae
py3: docbook_out: check/convert outline-level
ThomasWaldmann Jul 19, 2019
aa43e7b
py3: no __future__
ThomasWaldmann Jul 19, 2019
74bf84d
py3: Item/Revision: fix sorting
ThomasWaldmann Jul 19, 2019
8d3a613
py3: Item/Revision: we can only stable sort revs of different mtimes
ThomasWaldmann Jul 19, 2019
4d1f05e
py3: coding_std.py
RogerHaase Jul 19, 2019
183a0f8
py3: fix StopIteration exception coming out of a generator
ThomasWaldmann Jul 19, 2019
9620b7d
py3: fix bug in quickinstall, m css
RogerHaase Jul 20, 2019
52d29b6
py3: fix frontend tests type issue, bytes -> str
ThomasWaldmann Jul 20, 2019
df9ee89
py3: fix frontend views, remove encode/decode dance
ThomasWaldmann Jul 20, 2019
96c4bd6
py3: moinwiki_in tests: only use 1 table attribute
ThomasWaldmann Jul 20, 2019
e34b00a
py3: forms: cast exception to str before translating
ThomasWaldmann Jul 20, 2019
3c61451
py3: fix issues found when trying to rebuild the index
ThomasWaldmann Jul 21, 2019
830be3f
py3: rst_in: only take line number from node if it is an int
ThomasWaldmann Jul 21, 2019
b895522
py3: fix bytes issue in edit_locking
RogerHaase Jul 21, 2019
3105584
py3: deal with inspect.getargspec deprecation, use getfullargspec
ThomasWaldmann Jul 26, 2019
642cfb7
py3: rather use importlib than the deprecated imp lib
ThomasWaldmann Jul 27, 2019
6efb71f
py3: hotshot profiler is gone in python 3
ThomasWaldmann Jul 27, 2019
f909457
py3: fix test.wsgi script for python 3
ThomasWaldmann Jul 27, 2019
3eab908
py3: fix prints in dump_html
ThomasWaldmann Jul 27, 2019
1430606
py3: get rid of fuid(), troubles on win32 and not used, fixes #856
ThomasWaldmann Jul 27, 2019
324dd39
py3: fix get_names, bytes vs. str
ThomasWaldmann Jul 27, 2019
5cb0bc8
add comments with links to related code to /templates/usersettings.html
RogerHaase Jul 28, 2019
a5ea53d
eliminate duplicate use of variable "name" in UserSettingsPersonalForm
RogerHaase Jul 28, 2019
f833d53
fix javascript broken by prior patch
RogerHaase Jul 28, 2019
8d6de95
html-dump now handles items in non-default namespace
RogerHaase Jul 28, 2019
7376304
py3: update /contrib/loadtesting/locust scripts
RogerHaase Jul 29, 2019
2ca7b19
py3: fixes #862 bytes vs string traceback in "moin item-get...", part…
RogerHaase Aug 2, 2019
4804b8d
remove redundant code in /maint/modify_item.py splitting/rejoining lines
RogerHaase Aug 2, 2019
a070845
py3: fix #863 bytes vs string traceback after edit conflict
RogerHaase Aug 3, 2019
76beeb2
fix #864 Inconsistent line endings in /wiki/data/default/data/: \r\n …
RogerHaase Aug 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
language: python
sudo: false
dist: xenial
os: linux

matrix:
include:
- python: 2.7
os: linux
dist: xenial
env: TOXENV=py27
- python: pypy
os: linux
dist: xenial
env: TOXENV=pypy
- python: 2.7
os: linux
dist: xenial
- python: 3.5
env: TOXENV=py35
- python: 3.6
env: TOXENV=py36
- python: 3.7
env: TOXENV=py37
- python: 3.8-dev
env: TOXENV=py38
- python: 3.5
env: TOXENV=flake8
allow_failures:
- python: pypy

install:
- pip install -r requirements.d/development.txt
Expand Down
2 changes: 1 addition & 1 deletion _ui_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def pytest_runtest_makereport(item, call):
if call.excinfo is not None:
if driver_register.get_driver() is not None and hasattr(item, 'obj'):
driver_register.get_driver().get_screenshot_as_file(
unicode(item.obj).split(u" ")[2] + u'.png')
str(item.obj).split(" ")[2] + '.png')
50 changes: 25 additions & 25 deletions _ui_tests/test_subitems.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
import utils


class TestSubitems(object):
class TestSubitems:
"""Functional test: create subitem"""

def setup_class(self):
"""opens browser and creates some random item names for these tests"""
self.driver = utils.create_browser()
self.base_url = config.BASE_URL
self.base_item_name = u"page_" + utils.generate_random_word(5)
self.subitem_name = u"subitem_" + utils.generate_random_word(5)
self.base_item_name = "page_" + utils.generate_random_word(5)
self.subitem_name = "subitem_" + utils.generate_random_word(5)

def create_wiki_item(self, item_name):
"""Creates a new wiki item with name 'item_name'"""
driver = self.driver

driver.get(self.base_url + u"/" + item_name)
driver.find_element_by_link_text(u"Default").click()
driver.find_element_by_link_text(u"Wiki (MoinMoin)").click()
driver.get(self.base_url + "/" + item_name)
driver.find_element_by_link_text("Default").click()
driver.find_element_by_link_text("Wiki (MoinMoin)").click()
driver.find_element_by_link_text(
u"create the item from scratch").click()
"create the item from scratch").click()
driver.find_element_by_id("f_content_form_data_text").send_keys(
u"This is a test item\n")
"This is a test item\n")
driver.find_element_by_id("f_submit").click()

def test_createsubitem(self):
Expand All @@ -36,28 +36,28 @@ def test_createsubitem(self):

self.create_wiki_item(self.base_item_name)

driver.get(self.base_url + u"/" + self.base_item_name)
driver.find_element_by_link_text(u"Modify").click()
driver.find_element_by_id(u"f_content_form_data_text").send_keys(
u"\n[[/" + self.subitem_name + "]]\n")
driver.find_element_by_id(u"f_submit").click()
driver.find_element_by_link_text(u"/" + self.subitem_name).click()
driver.find_element_by_link_text(u"Default").click()
driver.find_element_by_link_text(u"Wiki (MoinMoin)").click()
driver.find_element_by_link_text(u"create the item from scratch").click()
driver.find_element_by_id(u"f_content_form_data_text").send_keys(
u"This is a test subitem")
driver.find_element_by_id(u"f_submit").click()
assert u"This is a test subitem" in driver.find_element_by_id(
u"moin-content-data").text
assert driver.title.split(u" - ")[0] == self.base_item_name + \
u"/" + self.subitem_name
driver.get(self.base_url + "/" + self.base_item_name)
driver.find_element_by_link_text("Modify").click()
driver.find_element_by_id("f_content_form_data_text").send_keys(
"\n[[/" + self.subitem_name + "]]\n")
driver.find_element_by_id("f_submit").click()
driver.find_element_by_link_text("/" + self.subitem_name).click()
driver.find_element_by_link_text("Default").click()
driver.find_element_by_link_text("Wiki (MoinMoin)").click()
driver.find_element_by_link_text("create the item from scratch").click()
driver.find_element_by_id("f_content_form_data_text").send_keys(
"This is a test subitem")
driver.find_element_by_id("f_submit").click()
assert "This is a test subitem" in driver.find_element_by_id(
"moin-content-data").text
assert driver.title.split(" - ")[0] == self.base_item_name + \
"/" + self.subitem_name

def teardown_class(self):
"""shuts down browser"""
self.driver.quit()

if __name__ == u'__main__':
if __name__ == '__main__':
# This lets us run the test directly, without using py.test
# This is useful for example for being able to call help, eg
# 'help(driver)', or 'help(driver.find_element_by_id("f_submit"))'
Expand Down
6 changes: 3 additions & 3 deletions _ui_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""Functions to facilitate functional testing"""

import random
import urllib
import urllib.request, urllib.parse, urllib.error

import pytest

Expand All @@ -15,7 +15,7 @@
import config

try:
f = urllib.urlopen(config.BASE_URL)
f = urllib.request.urlopen(config.BASE_URL)
except IOError:
pytestmark = pytest.mark.skip('The UI tests need a wiki server running on %s' % config.BASE_URL)

Expand All @@ -41,7 +41,7 @@ def generate_random_word(length):
"""
generates a random string containing numbers, of length 'length'
"""
word = unicode(random.randint(10 ** (length - 1), 10 ** length))
word = str(random.randint(10 ** (length - 1), 10 ** length))
return word


Expand Down
74 changes: 40 additions & 34 deletions contrib/loadtesting/locust/locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
and create wiki items as part of the test. It is best to start with
an empty wiki (./m new-wiki).

Each locust registers a new id, creates and updates a home page in the user namespace,
creates and updates a <username> item in the default namespace, and logs-out. Because
each locust is working on unique items, it does not test edit locking. Use locustfile2.py
for stress testing edit locking.

To load test Moin2:
* read about Locust at https://docs.locust.io/en/stable/index.html
* install Locust per the docs
Expand All @@ -39,15 +44,14 @@

import sys
import argparse
import urllib
import urllib2
import urllib.request, urllib.error, urllib.parse

from locust import HttpLocust, Locust, TaskSet, TaskSequence, task, seq_task


user_number = 0
# test content to put load on indexer
extra_content = u"""
extra_content = """
= %s Home Page =

== Writing a locustfile ==
Expand Down Expand Up @@ -98,7 +102,7 @@ def get_home(self):
# Home and users/Home have been created by setup, see below
response = self.client.get("/Home")
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(1)
def click_login(self):
Expand All @@ -107,16 +111,16 @@ def click_login(self):
self.user_name = 'JohnDoe' + str(user_number)
self.user_email = self.user_name + '@john.doe'
self.user_home_page = '/users/' + self.user_name
print '==== starting user = %s ====' % self.user_name
print('==== starting user = %s ====' % self.user_name)
response = self.client.get("/+login")
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(2)
def click_register(self):
response = self.client.get("/+register")
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(3)
def click_post_register(self):
Expand All @@ -127,13 +131,13 @@ def click_post_register(self):
"register_email": self.user_email,
})
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(4)
def click_login_again(self):
response = self.client.get("/+login")
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(5)
def click_post_login(self):
Expand All @@ -144,7 +148,7 @@ def click_post_login(self):
"login_nexturl": "/Home",
})
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(6)
def create_home_page(self):
Expand All @@ -153,12 +157,12 @@ def create_home_page(self):
if response.status_code == 404:
response.success()
else:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))
# click MoinMoin markup link
home_page_get = '/+modify/users/' + self.user_name + '?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default'
response = self.client.get(home_page_get)
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))
# complete form and post
new_content = '= %s =\n\nMy Home Page created by Locust' % self.user_name
home_page_post = '/+modify/users/' + self.user_name + '?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default&template='
Expand All @@ -174,34 +178,34 @@ def create_home_page(self):
"extra_meta_text": '{"namespace": "users","rev_number": 1}',
})
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(7)
@task(4)
def modify_home_page(self):
# get users home page
response = self.client.get(self.user_home_page)
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))
# click modify link
home_page = '/+modify' + self.user_home_page + '?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default&template='
response = self.client.get(home_page)
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))
# update the page
response = self.client.post(home_page,
{"content_form_data_text": extra_content % self.user_name,
"comment": "my homepage comment",
"submit": "OK",
u'meta_form_contenttype': u'text/x.moin.wiki;charset=utf-8',
'meta_form_contenttype': 'text/x.moin.wiki;charset=utf-8',
"meta_form_itemtype": "default",
"meta_form_acl": "None",
"meta_form_tags": "apple, pear",
"meta_form_name": self.user_name,
"extra_meta_text": '{"namespace": "users","rev_number":1}',
})
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(8)
def create_new_page(self):
Expand All @@ -211,12 +215,12 @@ def create_new_page(self):
if response.status_code == 404:
response.success()
else:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))
# click MoinMoin markup link
page_get = '/+modify/' + new_item_name + '?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default'
response = self.client.get(page_get)
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))
# complete form and post
new_content = '= %s =\n\nNew Item created by Locust' % new_item_name
new_page_post = '/+modify/' + new_item_name + '?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default&template='
Expand All @@ -232,7 +236,7 @@ def create_new_page(self):
"extra_meta_text": '{"namespace": "","rev_number": 1}',
})
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(9)
@task(10)
Expand All @@ -241,12 +245,12 @@ def modify_new_page(self):
new_item_name = 'Locust-' + self.user_name
response = self.client.get('/' + new_item_name)
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))
# click MoinMoin markup link
page_get = '/+modify/' + new_item_name + '?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default'
response = self.client.get(page_get)
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))
# complete form and post
new_content = '= %s =\n\nNew Item created by Locust' % new_item_name
new_page_post = '/+modify/' + new_item_name + '?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default&template='
Expand All @@ -262,13 +266,13 @@ def modify_new_page(self):
"extra_meta_text": '{"namespace": "","rev_number": 1}',
})
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))

@seq_task(10)
def logout(self):
response = self.client.get(u"/+logout?logout_submit=1")
response = self.client.get("/+logout?logout_submit=1")
if response.status_code != 200:
print '%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code)
print('%s: response.status_code = %s' % (sys._getframe().f_lineno, response.status_code))


class WebsiteUser(HttpLocust):
Expand All @@ -287,29 +291,31 @@ def setup(self):
if host.endswith('/'):
host = host[:-1]

print '==== creating Home and users/Home ===='
url = host + u"/+modify/users/Home?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default&template="
data = urllib.urlencode({"content_form_data_text": "= users/Home =\n * created by Locust",
print('==== creating Home and users/Home ====')
url = host + "/+modify/users/Home?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default&template="
data = urllib.parse.urlencode({"content_form_data_text": "= users/Home =\n * created by Locust",
"comment": "",
"submit": "OK",
u'meta_form_contenttype': u'text/x.moin.wiki;charset=utf-8',
'meta_form_contenttype': 'text/x.moin.wiki;charset=utf-8',
"meta_form_itemtype": "default",
"meta_form_acl": "None",
"meta_form_tags": "None",
"meta_form_name": "Home",
"extra_meta_text": '{"namespace": "users","rev_number": 1}',
})
content = urllib2.urlopen(url=url, data=data).read()
data = data.encode('utf-8')
content = urllib.request.urlopen(url=url, data=data).read()

url = host + u"/+modify/Home?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default&template="
data = urllib.urlencode({"content_form_data_text": "= Home =\n * created by Locust",
url = host + "/+modify/Home?contenttype=text%2Fx.moin.wiki%3Bcharset%3Dutf-8&itemtype=default&template="
data = urllib.parse.urlencode({"content_form_data_text": "= Home =\n * created by Locust",
"comment": "",
"submit": "OK",
u'meta_form_contenttype': u'text/x.moin.wiki;charset=utf-8',
'meta_form_contenttype': 'text/x.moin.wiki;charset=utf-8',
"meta_form_itemtype": "default",
"meta_form_acl": "None",
"meta_form_tags": "None",
"meta_form_name": "Home",
"extra_meta_text": '{"namespace": "","rev_number": 1}',
})
content = urllib2.urlopen(url=url, data=data).read()
data = data.encode('utf-8')
content = urllib.request.urlopen(url=url, data=data).read()
Loading