Skip to content

Commit edbdc02

Browse files
Merge pull request #125 from Flutterwave/dev
pull changes from dev branch
2 parents 345f3d3 + 165e199 commit edbdc02

File tree

13 files changed

+3437
-2
lines changed

13 files changed

+3437
-2
lines changed

.github/workflows/change-review.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- name: checkout code
1818
uses: actions/checkout@v2
19-
19+
2020
- name: setup python environment
2121
uses: actions/setup-python@v2
2222
with:

.github/workflows/security-scan.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Security scan on all changes (Commits/PRs)
2+
3+
on:
4+
push:
5+
branches: ['main', 'master', 'pilots', 'dev']
6+
pull_request:
7+
types:
8+
- opened
9+
10+
jobs:
11+
code-check:
12+
runs-on: ubuntu-latest
13+
env:
14+
OS: ubuntu-latest
15+
PYTHON: '3.7'
16+
steps:
17+
- name: checkout code
18+
uses: actions/checkout@v2
19+
20+
21+
- name: Checkmarx One ClI Action
22+
uses: checkmarx/ast-github-action@main
23+
with:
24+
project_name: Python-v2
25+
cx_tenant: Flutterwave
26+
base_uri: https://eu.ast.checkmarx.net/
27+
cx_client_id: ${{ secrets.CX_CLIENT_ID }}
28+
cx_client_secret: ${{ secrets.CX_CLIENT_SECRET }}
29+
additional_params: --scan-types sast,iac-security,api-security,sca,container-security

test.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Local imports
1111
from rave_python import Rave, RaveExceptions, Misc
1212
from rave_python.rave_exceptions import *
13-
from example import *
1413

1514
load_dotenv()
1615

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2003-2013, Michael Foord & the mock team
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
Metadata-Version: 2.1
2+
Name: mock
3+
Version: 5.1.0
4+
Summary: Rolling backport of unittest.mock for all Pythons
5+
Home-page: http://mock.readthedocs.org/en/latest/
6+
Author: Testing Cabal
7+
Author-email: [email protected]
8+
Project-URL: Source, https://github.com/testing-cabal/mock
9+
Classifier: Development Status :: 5 - Production/Stable
10+
Classifier: Environment :: Console
11+
Classifier: Intended Audience :: Developers
12+
Classifier: License :: OSI Approved :: BSD License
13+
Classifier: Operating System :: OS Independent
14+
Classifier: Programming Language :: Python
15+
Classifier: Programming Language :: Python :: 3.6
16+
Classifier: Programming Language :: Python :: 3.7
17+
Classifier: Programming Language :: Python :: 3.8
18+
Classifier: Programming Language :: Python :: 3.9
19+
Classifier: Programming Language :: Python :: 3.10
20+
Classifier: Programming Language :: Python :: 3.11
21+
Classifier: Programming Language :: Python :: Implementation :: CPython
22+
Classifier: Programming Language :: Python :: Implementation :: PyPy
23+
Classifier: Topic :: Software Development :: Libraries
24+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
25+
Classifier: Topic :: Software Development :: Testing
26+
Requires-Python: >=3.6
27+
License-File: LICENSE.txt
28+
Provides-Extra: build
29+
Requires-Dist: twine ; extra == 'build'
30+
Requires-Dist: wheel ; extra == 'build'
31+
Requires-Dist: blurb ; extra == 'build'
32+
Provides-Extra: docs
33+
Requires-Dist: sphinx ; extra == 'docs'
34+
Provides-Extra: test
35+
Requires-Dist: pytest ; extra == 'test'
36+
Requires-Dist: pytest-cov ; extra == 'test'
37+
38+
mock is a library for testing in Python. It allows you to replace parts of
39+
your system under test with mock objects and make assertions about how they
40+
have been used.
41+
42+
mock is now part of the Python standard library, available as `unittest.mock
43+
<https://docs.python.org/dev/library/unittest.mock.html>`_ in Python 3.3
44+
onwards.
45+
46+
This package contains a rolling backport of the standard library mock code
47+
compatible with Python 3.6 and up.
48+
49+
Please see the standard library documentation for more details.
50+
51+
:Homepage: `Mock Homepage`_
52+
:Download: `Mock on PyPI`_
53+
:Documentation: `Python Docs`_
54+
:License: `BSD License`_
55+
:Support: `Mailing list ([email protected])
56+
<http://lists.idyll.org/listinfo/testing-in-python>`_
57+
:Code: `GitHub
58+
<https://github.com/testing-cabal/mock>`_
59+
:Issue tracker: `GitHub Issues
60+
<https://github.com/testing-cabal/mock/issues>`_
61+
:Build status:
62+
|CircleCI|_ |Docs|_
63+
64+
.. |CircleCI| image:: https://circleci.com/gh/testing-cabal/mock/tree/master.svg?style=shield
65+
.. _CircleCI: https://circleci.com/gh/testing-cabal/mock/tree/master
66+
67+
.. |Docs| image:: https://readthedocs.org/projects/mock/badge/?version=latest
68+
.. _Docs: http://mock.readthedocs.org/en/latest/
69+
70+
.. _Mock Homepage: http://mock.readthedocs.org/en/latest/
71+
.. _BSD License: https://github.com/testing-cabal/mock/blob/master/LICENSE.txt
72+
.. _Python Docs: https://docs.python.org/dev/library/unittest.mock.html
73+
.. _mock on PyPI: https://pypi.org/project/mock/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
mock-5.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2+
mock-5.1.0.dist-info/LICENSE.txt,sha256=WDHuFJ04ULKN-P8C-3vQfOzagehcyENcIIJ9OSIgLTQ,1342
3+
mock-5.1.0.dist-info/METADATA,sha256=Iicx5nRT5scGjfpkiK-fn5XdZ5WLvD65RfWMPH_mIqY,3019
4+
mock-5.1.0.dist-info/RECORD,,
5+
mock-5.1.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6+
mock-5.1.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
7+
mock-5.1.0.dist-info/top_level.txt,sha256=YbGUYXa21gMdoMrELg81nnfkfBId5JGAm7K8bMU8hWQ,5
8+
mock/__init__.py,sha256=BS2JIiTBFBFcvF-m-XOXhUMQox-UP0yyLGrVlIphqWc,334
9+
mock/__pycache__/__init__.cpython-310.pyc,,
10+
mock/__pycache__/backports.cpython-310.pyc,,
11+
mock/__pycache__/mock.cpython-310.pyc,,
12+
mock/backports.py,sha256=zxu3FnFkPFT-vy9LTYcER-dhDYcQSwHtbGIYavET3q8,2808
13+
mock/mock.py,sha256=Tio5teqGbCUrNoyyO6E6KjoFbiatDpNEwjuI7wJ_ji8,110383

testing/lib/python3.10/site-packages/mock-5.1.0.dist-info/REQUESTED

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Wheel-Version: 1.0
2+
Generator: bdist_wheel (0.40.0)
3+
Root-Is-Purelib: true
4+
Tag: py3-none-any
5+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mock
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from __future__ import absolute_import
2+
3+
import re, sys
4+
5+
IS_PYPY = 'PyPy' in sys.version
6+
7+
import mock.mock as _mock
8+
from mock.mock import *
9+
10+
__version__ = '5.1.0'
11+
version_info = tuple(int(p) for p in
12+
re.match(r'(\d+).(\d+).(\d+)', __version__).groups())
13+
14+
15+
__all__ = ('__version__', 'version_info') + _mock.__all__
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import sys
2+
3+
4+
if sys.version_info[:2] < (3, 8):
5+
6+
import asyncio, functools
7+
from asyncio.coroutines import _is_coroutine
8+
from inspect import ismethod, isfunction, CO_COROUTINE
9+
from unittest import TestCase
10+
11+
def _unwrap_partial(func):
12+
while isinstance(func, functools.partial):
13+
func = func.func
14+
return func
15+
16+
def _has_code_flag(f, flag):
17+
"""Return true if ``f`` is a function (or a method or functools.partial
18+
wrapper wrapping a function) whose code object has the given ``flag``
19+
set in its flags."""
20+
while ismethod(f):
21+
f = f.__func__
22+
f = _unwrap_partial(f)
23+
if not isfunction(f):
24+
return False
25+
return bool(f.__code__.co_flags & flag)
26+
27+
def iscoroutinefunction(obj):
28+
"""Return true if the object is a coroutine function.
29+
30+
Coroutine functions are defined with "async def" syntax.
31+
"""
32+
return (
33+
_has_code_flag(obj, CO_COROUTINE) or
34+
getattr(obj, '_is_coroutine', None) is _is_coroutine
35+
)
36+
37+
38+
class IsolatedAsyncioTestCase(TestCase):
39+
40+
def __init__(self, methodName='runTest'):
41+
super().__init__(methodName)
42+
self._asyncioTestLoop = None
43+
self._asyncioCallsQueue = None
44+
45+
async def _asyncioLoopRunner(self, fut):
46+
self._asyncioCallsQueue = queue = asyncio.Queue()
47+
fut.set_result(None)
48+
while True:
49+
query = await queue.get()
50+
queue.task_done()
51+
assert query is None
52+
53+
def _setupAsyncioLoop(self):
54+
assert self._asyncioTestLoop is None
55+
loop = asyncio.new_event_loop()
56+
asyncio.set_event_loop(loop)
57+
loop.set_debug(True)
58+
self._asyncioTestLoop = loop
59+
fut = loop.create_future()
60+
self._asyncioCallsTask = loop.create_task(self._asyncioLoopRunner(fut))
61+
loop.run_until_complete(fut)
62+
63+
def _tearDownAsyncioLoop(self):
64+
assert self._asyncioTestLoop is not None
65+
loop = self._asyncioTestLoop
66+
self._asyncioTestLoop = None
67+
self._asyncioCallsQueue.put_nowait(None)
68+
loop.run_until_complete(self._asyncioCallsQueue.join())
69+
70+
try:
71+
# shutdown asyncgens
72+
loop.run_until_complete(loop.shutdown_asyncgens())
73+
finally:
74+
asyncio.set_event_loop(None)
75+
loop.close()
76+
77+
def run(self, result=None):
78+
self._setupAsyncioLoop()
79+
try:
80+
return super().run(result)
81+
finally:
82+
self._tearDownAsyncioLoop()
83+
84+
85+
else:
86+
87+
from asyncio import iscoroutinefunction
88+
from unittest import IsolatedAsyncioTestCase
89+

0 commit comments

Comments
 (0)