[Python-modules-commits] [python-molotov] 01/05: import python-molotov_1.4.orig.tar.gz

Ondrej Novy onovy at debian.org
Sun Feb 4 09:35:33 UTC 2018


This is an automated email from the git hooks/post-receive script.

onovy pushed a commit to branch master
in repository python-molotov.

commit dd775394135e0c260fcf6525077e4e09094b2b0c
Author: Ondřej Nový <onovy at debian.org>
Date:   Sun Feb 4 10:28:42 2018 +0100

    import python-molotov_1.4.orig.tar.gz
---
 .travis.yml                           |  32 +++
 CHANGELOG.rst                         |  50 ++++
 LICENSE                               | 202 ++++++++++++++
 MANIFEST.in                           |  14 +
 Makefile                              |  26 ++
 PKG-INFO                              |  92 ++++++
 README.rst                            |  25 ++
 docs-requirements.txt                 |   1 +
 molotov.egg-info/PKG-INFO             |  92 ++++++
 molotov.egg-info/SOURCES.txt          |  57 ++++
 molotov.egg-info/dependency_links.txt |   1 +
 molotov.egg-info/entry_points.txt     |   6 +
 molotov.egg-info/not-zip-safe         |   1 +
 molotov.egg-info/requires.txt         |   2 +
 molotov.egg-info/top_level.txt        |   1 +
 molotov.json                          |  38 +++
 molotov/__init__.py                   |  11 +
 molotov/api.py                        | 226 +++++++++++++++
 molotov/listeners.py                  | 120 ++++++++
 molotov/quickstart/Makefile           |  20 ++
 molotov/quickstart/__init__.py        |  88 ++++++
 molotov/quickstart/loadtest.py        |  80 ++++++
 molotov/quickstart/molotov.json       |  20 ++
 molotov/run.py                        | 223 +++++++++++++++
 molotov/runner.py                     | 190 +++++++++++++
 molotov/session.py                    |  93 +++++++
 molotov/sharedconsole.py              |  73 +++++
 molotov/sharedcounter.py              | 108 ++++++++
 molotov/slave.py                      | 122 ++++++++
 molotov/stats.py                      |   5 +
 molotov/tests/__init__.py             |   0
 molotov/tests/example.py              |  63 +++++
 molotov/tests/example2.py             |  23 ++
 molotov/tests/example3.py             |  11 +
 molotov/tests/example4.py             |  64 +++++
 molotov/tests/example5.py             |  27 ++
 molotov/tests/example6.py             |  30 ++
 molotov/tests/example7.py             |  28 ++
 molotov/tests/example8.py             |  49 ++++
 molotov/tests/molotov.json            |  29 ++
 molotov/tests/statsd.py               |  65 +++++
 molotov/tests/support.py              | 279 +++++++++++++++++++
 molotov/tests/test_api.py             |  92 ++++++
 molotov/tests/test_fmwk.py            | 350 +++++++++++++++++++++++
 molotov/tests/test_listeners.py       |  37 +++
 molotov/tests/test_quickstart.py      |  73 +++++
 molotov/tests/test_run.py             | 507 ++++++++++++++++++++++++++++++++++
 molotov/tests/test_session.py         | 181 ++++++++++++
 molotov/tests/test_sharedconsole.py   |  97 +++++++
 molotov/tests/test_sharedcounter.py   |  82 ++++++
 molotov/tests/test_slave.py           |  35 +++
 molotov/tests/test_util.py            |  84 ++++++
 molotov/util.py                       | 252 +++++++++++++++++
 molotov/worker.py                     | 182 ++++++++++++
 requirements.txt                      |   2 +
 setup.cfg                             |   4 +
 setup.py                              |  38 +++
 tox-requirements.txt                  |   2 +
 tox.ini                               |  42 +++
 59 files changed, 4747 insertions(+)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..07d31ea
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,32 @@
+language: python
+python: 3.5
+compiler: gcc
+matrix:
+  include:
+    - python: 3.6
+      env:
+      - TOX_ENV=py36
+addons:
+  apt:
+    packages:
+        - pypy-dev
+        - liblapack-dev
+env:
+ - TOX_ENV=py35
+ - TOX_ENV=docs
+ - TOX_ENV=flake8
+ - TOX_ENV=pypy3
+install:
+ - |
+        if [[ "${TOX_ENV}" = pypy3 ]]; then
+            rm -rf ~/.pyenv
+            git clone https://github.com/yyuu/pyenv.git ~/.pyenv
+            PYENV_ROOT="$HOME/.pyenv"
+            PATH="$PYENV_ROOT/bin:$PATH"
+            eval "$(pyenv init -)"
+            pyenv install pypy3.5-5.8.0
+            pyenv global pypy3.5-5.8.0
+        fi
+ - pip install tox
+script:
+ - tox -e $TOX_ENV
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
new file mode 100644
index 0000000..3b8dfc1
--- /dev/null
+++ b/CHANGELOG.rst
@@ -0,0 +1,50 @@
+CHANGELOG
+=========
+
+1.4 - 2017-09-26
+----------------
+
+- statsd: moved from aiostatsd to aiomeasures
+- Added --sizing and --sizing-tolerance (#72)
+- Refactored shared counters
+- Implemented a shared console (#42)
+- Improved shutdown process (#67)
+- Refactored fmwk.py (#25)
+- Add a way to record requests and responses (#80)
+- added --use-extension
+- added events
+- published tests/examples*.py to the docs (#90)
+
+
+1.3 - 2017-07-28
+----------------
+
+- fixed file-based requests with sessions -vvv option (#73)
+- proper managment of the verbose option in moloslave
+- added uvloop support (#68)
+- added initial PyPy support (#47)
+- Added name & @scenario_picker() options (#65)
+
+
+1.2 - 2017-06-15
+----------------
+
+- improved docs
+- added delay options (#48)
+- added --ramp-up option (#61)
+- fix a bug on response display (#62)
+
+
+1.1 - 2017-06-09
+----------------
+
+- added request and json_request helpers (#50)
+- added session setup and teardown fixtures (#52)
+- added set_var & get_var helpers (#54)
+- fixed thhe code generated by molostart (#55)
+
+
+1.0 - 2017-03-23
+----------------
+
+- Initial stable release
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..8f71f43
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..eb06721
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,14 @@
+include CHANGELOG.rst
+include README.rst
+include LICENSE
+include CHANGES.rst
+include requirements.txt
+include tox-requirements.txt
+include docs-requirements.txt
+include tox.ini
+include .travis.yml
+include molotov.json
+include Makefile
+include molotov/tests/molotov.json
+include molotov/quickstart/Makefile
+include molotov/quickstart/molotov.json
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ae6ca01
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+HERE = $(shell pwd)
+BIN = $(HERE)/bin
+PYTHON = $(BIN)/python
+INSTALL = $(BIN)/pip install --no-deps
+BUILD_DIRS = bin build include lib lib64 man share
+VIRTUALENV = virtualenv
+
+.PHONY: all test build clean docs
+
+all: build
+
+$(PYTHON):
+	$(VIRTUALENV) $(VTENV_OPTS) .
+
+build: $(PYTHON)
+	$(PYTHON) setup.py develop
+	$(BIN)/pip install tox
+
+clean:
+	rm -rf $(BUILD_DIRS)
+
+test: build
+	$(BIN)/tox
+
+docs:  build
+	$(BIN)/tox -e docs
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..f4b895f
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,92 @@
+Metadata-Version: 1.1
+Name: molotov
+Version: 1.4
+Summary: Spiffy load testing tool.
+Home-page: https://molotov.readthedocs.io
+Author: Tarek Ziade
+Author-email: tarek at ziade.org
+License: UNKNOWN
+Description: =======
+        molotov
+        =======
+        
+        
+        .. image:: http://coveralls.io/repos/github/loads/molotov/badge.svg?branch=master
+           :target: https://coveralls.io/github/loads/molotov?branch=master
+        
+        .. image:: http://travis-ci.org/loads/molotov.svg?branch=master
+           :target: https://travis-ci.org/loads/molotov
+        
+        .. image:: http://readthedocs.org/projects/molotov/badge/?version=latest
+           :target: https://molotov.readthedocs.io
+        
+        .. image:: https://img.shields.io/pypi/pyversions/molotov.svg
+           :target: https://molotov.readthedocs.io
+        
+        
+        Simple Python 3.5+ tool to write load tests.
+        
+        Based on `asyncio <https://docs.python.org/3/library/asyncio.html>`_,
+        Built with `aiohttp <http://aiohttp.readthedocs.io>`_ .
+        
+        `Full Documentation <https://molotov.readthedocs.io>`_
+        
+        
+        
+        CHANGELOG
+        =========
+        
+        1.4 - 2017-09-26
+        ----------------
+        
+        - statsd: moved from aiostatsd to aiomeasures
+        - Added --sizing and --sizing-tolerance (#72)
+        - Refactored shared counters
+        - Implemented a shared console (#42)
+        - Improved shutdown process (#67)
+        - Refactored fmwk.py (#25)
+        - Add a way to record requests and responses (#80)
+        - added --use-extension
+        - added events
+        - published tests/examples*.py to the docs (#90)
+        
+        
+        1.3 - 2017-07-28
+        ----------------
+        
+        - fixed file-based requests with sessions -vvv option (#73)
+        - proper managment of the verbose option in moloslave
+        - added uvloop support (#68)
+        - added initial PyPy support (#47)
+        - Added name & @scenario_picker() options (#65)
+        
+        
+        1.2 - 2017-06-15
+        ----------------
+        
+        - improved docs
+        - added delay options (#48)
+        - added --ramp-up option (#61)
+        - fix a bug on response display (#62)
+        
+        
+        1.1 - 2017-06-09
+        ----------------
+        
+        - added request and json_request helpers (#50)
+        - added session setup and teardown fixtures (#52)
+        - added set_var & get_var helpers (#54)
+        - fixed thhe code generated by molostart (#55)
+        
+        
+        1.0 - 2017-03-23
+        ----------------
+        
+        - Initial stable release
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..9d6bf12
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,25 @@
+=======
+molotov
+=======
+
+
+.. image:: http://coveralls.io/repos/github/loads/molotov/badge.svg?branch=master
+   :target: https://coveralls.io/github/loads/molotov?branch=master
+
+.. image:: http://travis-ci.org/loads/molotov.svg?branch=master
+   :target: https://travis-ci.org/loads/molotov
+
+.. image:: http://readthedocs.org/projects/molotov/badge/?version=latest
+   :target: https://molotov.readthedocs.io
+
+.. image:: https://img.shields.io/pypi/pyversions/molotov.svg
+   :target: https://molotov.readthedocs.io
+
+
+Simple Python 3.5+ tool to write load tests.
+
+Based on `asyncio <https://docs.python.org/3/library/asyncio.html>`_,
+Built with `aiohttp <http://aiohttp.readthedocs.io>`_ .
+
+`Full Documentation <https://molotov.readthedocs.io>`_
+
diff --git a/docs-requirements.txt b/docs-requirements.txt
new file mode 100644
index 0000000..cb3c1f2
--- /dev/null
+++ b/docs-requirements.txt
@@ -0,0 +1 @@
+sphinx-argparse
diff --git a/molotov.egg-info/PKG-INFO b/molotov.egg-info/PKG-INFO
new file mode 100644
index 0000000..f4b895f
--- /dev/null
+++ b/molotov.egg-info/PKG-INFO
@@ -0,0 +1,92 @@
+Metadata-Version: 1.1
+Name: molotov
+Version: 1.4
+Summary: Spiffy load testing tool.
+Home-page: https://molotov.readthedocs.io
+Author: Tarek Ziade
+Author-email: tarek at ziade.org
+License: UNKNOWN
+Description: =======
+        molotov
+        =======
+        
+        
+        .. image:: http://coveralls.io/repos/github/loads/molotov/badge.svg?branch=master
+           :target: https://coveralls.io/github/loads/molotov?branch=master
+        
+        .. image:: http://travis-ci.org/loads/molotov.svg?branch=master
+           :target: https://travis-ci.org/loads/molotov
+        
+        .. image:: http://readthedocs.org/projects/molotov/badge/?version=latest
+           :target: https://molotov.readthedocs.io
+        
+        .. image:: https://img.shields.io/pypi/pyversions/molotov.svg
+           :target: https://molotov.readthedocs.io
+        
+        
+        Simple Python 3.5+ tool to write load tests.
+        
+        Based on `asyncio <https://docs.python.org/3/library/asyncio.html>`_,
+        Built with `aiohttp <http://aiohttp.readthedocs.io>`_ .
+        
+        `Full Documentation <https://molotov.readthedocs.io>`_
+        
+        
+        
+        CHANGELOG
+        =========
+        
+        1.4 - 2017-09-26
+        ----------------
+        
+        - statsd: moved from aiostatsd to aiomeasures
+        - Added --sizing and --sizing-tolerance (#72)
+        - Refactored shared counters
+        - Implemented a shared console (#42)
+        - Improved shutdown process (#67)
+        - Refactored fmwk.py (#25)
+        - Add a way to record requests and responses (#80)
+        - added --use-extension
+        - added events
+        - published tests/examples*.py to the docs (#90)
+        
+        
+        1.3 - 2017-07-28
+        ----------------
+        
+        - fixed file-based requests with sessions -vvv option (#73)
+        - proper managment of the verbose option in moloslave
+        - added uvloop support (#68)
+        - added initial PyPy support (#47)
+        - Added name & @scenario_picker() options (#65)
+        
+        
+        1.2 - 2017-06-15
+        ----------------
+        
+        - improved docs
+        - added delay options (#48)
+        - added --ramp-up option (#61)
+        - fix a bug on response display (#62)
+        
+        
+        1.1 - 2017-06-09
+        ----------------
+        
+        - added request and json_request helpers (#50)
+        - added session setup and teardown fixtures (#52)
+        - added set_var & get_var helpers (#54)
+        - fixed thhe code generated by molostart (#55)
+        
+        
+        1.0 - 2017-03-23
+        ----------------
+        
+        - Initial stable release
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
diff --git a/molotov.egg-info/SOURCES.txt b/molotov.egg-info/SOURCES.txt
new file mode 100644
index 0000000..4fcca86
--- /dev/null
+++ b/molotov.egg-info/SOURCES.txt
@@ -0,0 +1,57 @@
+.travis.yml
+CHANGELOG.rst
+LICENSE
+MANIFEST.in
+Makefile
+README.rst
+docs-requirements.txt
+molotov.json
+requirements.txt
+setup.py
+tox-requirements.txt
+tox.ini
+molotov/__init__.py
+molotov/api.py
+molotov/listeners.py
+molotov/run.py
+molotov/runner.py
+molotov/session.py
+molotov/sharedconsole.py
+molotov/sharedcounter.py
+molotov/slave.py
+molotov/stats.py
+molotov/util.py
+molotov/worker.py
+molotov.egg-info/PKG-INFO
+molotov.egg-info/SOURCES.txt
+molotov.egg-info/dependency_links.txt
+molotov.egg-info/entry_points.txt
+molotov.egg-info/not-zip-safe
+molotov.egg-info/requires.txt
+molotov.egg-info/top_level.txt
+molotov/quickstart/Makefile
+molotov/quickstart/__init__.py
+molotov/quickstart/loadtest.py
+molotov/quickstart/molotov.json
+molotov/tests/__init__.py
+molotov/tests/example.py
+molotov/tests/example2.py
+molotov/tests/example3.py
+molotov/tests/example4.py
+molotov/tests/example5.py
+molotov/tests/example6.py
+molotov/tests/example7.py
+molotov/tests/example8.py
+molotov/tests/molotov.json
+molotov/tests/statsd.py
+molotov/tests/support.py
+molotov/tests/test_api.py
+molotov/tests/test_fmwk.py
+molotov/tests/test_listeners.py
+molotov/tests/test_quickstart.py
+molotov/tests/test_run.py
+molotov/tests/test_session.py
+molotov/tests/test_sharedconsole.py
+molotov/tests/test_sharedcounter.py
+molotov/tests/test_slave.py
+molotov/tests/test_util.py
\ No newline at end of file
diff --git a/molotov.egg-info/dependency_links.txt b/molotov.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/molotov.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/molotov.egg-info/entry_points.txt b/molotov.egg-info/entry_points.txt
new file mode 100644
index 0000000..edccb2b
--- /dev/null
+++ b/molotov.egg-info/entry_points.txt
@@ -0,0 +1,6 @@
+
+      [console_scripts]
+      molotov = molotov.run:main
+      moloslave = molotov.slave:main
+      molostart = molotov.quickstart:main
+      
\ No newline at end of file
diff --git a/molotov.egg-info/not-zip-safe b/molotov.egg-info/not-zip-safe
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/molotov.egg-info/not-zip-safe
@@ -0,0 +1 @@
+
diff --git a/molotov.egg-info/requires.txt b/molotov.egg-info/requires.txt
new file mode 100644
index 0000000..9a6aa68
--- /dev/null
+++ b/molotov.egg-info/requires.txt
@@ -0,0 +1,2 @@
+aiohttp
+aiomeasures
diff --git a/molotov.egg-info/top_level.txt b/molotov.egg-info/top_level.txt
new file mode 100644
index 0000000..6f0d44c
--- /dev/null
+++ b/molotov.egg-info/top_level.txt
@@ -0,0 +1 @@
+molotov
diff --git a/molotov.json b/molotov.json
new file mode 100644
index 0000000..230e930
--- /dev/null
+++ b/molotov.json
@@ -0,0 +1,38 @@
+{
+    "molotov": {
+        "env": {
+            "SERVER_URL": "http://aserver.net"
+        },
+        "requirements": "requirements.txt",
+        "tests": {
+            "big": {
+                "console": true,
+                "duration": 10,
+                "exception": true,
+                "processes": 10,
+                "scenario": "molotov/tests/example.py",
+                "workers": 100
+            },
+            "fail": {
+                "exception": true,
+                "max_runs": 1,
+                "scenario": "molotov/tests/example3.py"
+            },
+            "scenario_two_once": {
+                "console": true,
+                "exception": true,
+                "max_runs": 1,
+                "scenario": "molotov/tests/example.py",
+                "single_mode": "scenario_two"
+            },
+            "test": {
+                "console": true,
+                "duration": 1,
+                "exception": true,
+                "verbose": 1,
+                "console_update": 0,
+                "scenario": "molotov/tests/example.py"
+            }
+        }
+    }
+}
diff --git a/molotov/__init__.py b/molotov/__init__.py
new file mode 100644
index 0000000..8d1b697
--- /dev/null
+++ b/molotov/__init__.py
@@ -0,0 +1,11 @@
+try:
+    from molotov.api import (scenario, setup, global_setup, teardown,  # NOQA
+                             global_teardown, setup_session,           # NOQA
+                             teardown_session, scenario_picker,        # NOQA
+                             events)                                   # NOQA
+    from molotov.util import request, json_request                     # NOQA
+    from molotov.util import set_var, get_var                          # NOQA
+except ImportError:
+    pass   # first import
+
+__version__ = '1.4'
diff --git a/molotov/api.py b/molotov/api.py
new file mode 100644
index 0000000..70b625d
--- /dev/null
+++ b/molotov/api.py
@@ -0,0 +1,226 @@
+import random
+import functools
+import asyncio
+
+
+_SCENARIO = {}
+
+
+def get_scenarios():
+    scenarios = list(_SCENARIO.items())
+    scenarios.sort()
+    return [scenario for (name, scenario) in scenarios]
+
+
+def get_scenario(name):
+    return _SCENARIO.get(name)
+
+
+def _check_coroutine(func):
+    if not asyncio.iscoroutinefunction(func):
+        raise TypeError('%s needs to be a coroutine' % str(func))
+
+
+def scenario(weight=1, delay=0.0, name=None):
+    """Decorator to register a function as a Molotov test.
+
+    Options:
+
+    - **weight** used by Molotov when the scenarii are randomly picked.
+      The functions with the highest values are more likely to be picked.
+      Integer, defaults to 1. This value is ignored when the
+      *scenario_picker* decorator is used.
+    - **delay** once the scenario is done, the worker will sleep
+      *delay* seconds. Float, defaults to 0.
+      The general --delay argument you can pass to Molotov
+      will be summed with this delay.
+    - **name** name of the scenario. If not provided, will use the
+      function __name___ attribute.
+
+    The decorated function receives an :class:`aoihttp.ClienSession` instance.
+    """
+    def _scenario(func, *args, **kw):
+        _check_coroutine(func)
+        if weight > 0:
+            sname = name or func.__name__
+            data = {'name': sname,
+                    'weight': weight, 'delay': delay,
+                    'func': func, 'args': args, 'kw': kw}
+            _SCENARIO[sname] = data
+
+        @functools.wraps(func)
+        def __scenario(*args, **kw):
+            return func(*args, **kw)
+        return __scenario
+
+    return _scenario
+
+
+def pick_scenario(worker_id=0, step_id=0):
+    custom_picker = get_fixture('scenario_picker')
+    if custom_picker is not None:
+        name = custom_picker(worker_id, step_id)
+        return get_scenario(name)
+
+    scenarios = get_scenarios()
+    total = sum(item['weight'] for item in scenarios)
+    selection = random.uniform(0, total)
+    upto = 0
+    for item in scenarios:
+        weight = item['weight']
+        if upto + weight > selection:
+            return item
+        upto += weight
+
+
+def scenario_picker():
+    """Called to chose a scenario.
+
+    Arguments received by the decorated function:
+
+    - **worker_id** the worker number
+    - **step_id** the loop counter
+
+    The decorated function should return the name
+    of the scenario the worker should execute next.
+
+    When used, the weights are ignored.
+
+    *The decorated function should not be a coroutine.*
+    """
+    return _fixture('scenario_picker', coroutine=False)
+
+
+_FIXTURES = {}
+
+
+def get_fixture(name):
+    return _FIXTURES.get(name)
+
+
+def _fixture(name, coroutine=True, multiple=False):
+    def __fixture(func, *args, **kw):
+        if coroutine:
+            _check_coroutine(func)
+        if name in _FIXTURES and not multiple:
+            raise ValueError("You can't have two %r functions" % name)
+        if multiple:
+            if name in _FIXTURES:
+                _FIXTURES[name].append(func)
+            else:
+                _FIXTURES[name] = [func]
+        else:
+            _FIXTURES[name] = func
+
+        @functools.wraps(func)
+        def ___fixture(*args, **kw):
+            return func(*args, **kw)
+
+        return ___fixture
+    return __fixture
+
+
+def setup():
+    """Called once per worker startup.
+
+    Arguments received by the decorated function:
+
+    - **worker_id** the worker number
+    - **args** arguments used to start Molotov.
+
+    The decorated function can send back a dict.
+    This dict will be passed to the :class:`aoihttp.ClientSession` class
+    as keywords when it's created.
+
+    This is useful when you need to set up session-wide options
+    like Authorization headers, or do whatever you need on startup.
+
+    *The decorated function should be a coroutine.*
+    """
+    return _fixture('setup')
+
+
+def global_setup():
+    """Called once when the test starts.
+
+    The decorated function is called before processes and workers
+    are created.
+
+    Arguments received by the decorated function:
+
+    - **args** arguments used to start Molotov.
+
+    This decorator is useful if you need to set up some fixtures that
+    are shared by all workers.
+
+    *The decorated function should not be a coroutine.*
+    """
+    return _fixture('global_setup', coroutine=False)
+
+
+def teardown():
+    """Called when a worker is done.
+
+    Arguments received by the decorated function:
+
+    - **worker_id** the worker number
+
+    *The decorated function should not be a coroutine.*
+    """
+    return _fixture('teardown', coroutine=False)
+
+
... 4167 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-molotov.git



More information about the Python-modules-commits mailing list