p4rk / known_side_effects Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
then(...) should always return whats passed into it. You may want to return an exception from a then without raising it.
then_raise(...) should raise the passed in value.
Add a the when function to the unittest Mock object.
Rather than passing the mock to the when function
when(mock, ...)
We should add the when function to the Mock object.
mock.when(...)
Implement an always function.
This function should cause the mock to always return what is passed in regardless of what parameters it was called with.
This should include a always_rasie function.
When using the known side effects library it needs to be imported to add the when function to the Mock class. When imported it isn't used anywhere and causes lint issues.
Add a extends
function to the library to enable extending of the Mock rather than just doing it.
import known_side_effects
known_side_effects.extend(Mock)
Rename Any to AnyArg to avoid import conflicts with typing.Any
It appears that the manifest is missing at least one file necessary to build
from the sdist for version 0.1.1. You're in good company, about 5% of other
projects updated in the last year are also missing files.
+ /tmp/venv/bin/pip3 wheel --no-binary known-side-effects -w /tmp/ext known-side-effects==0.1.1
Looking in indexes: http://10.10.0.139:9191/root/pypi/+simple/
Collecting known-side-effects==0.1.1
Downloading http://10.10.0.139:9191/root/pypi/%2Bf/c06/038be7efc3414/known_side_effects-0.1.1.tar.gz (5.8 kB)
ERROR: Command errored out with exit status 1:
command: /tmp/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-z4wum6er/known-side-effects/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-z4wum6er/known-side-effects/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-wheel-z4wum6er/known-side-effects/pip-egg-info
cwd: /tmp/pip-wheel-z4wum6er/known-side-effects/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-wheel-z4wum6er/known-side-effects/setup.py", line 3, in <module>
with open("../README.md", "r") as fh:
FileNotFoundError: [Errno 2] No such file or directory: '../README.md'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Implement an otherwise function that defines what the default behaviour should be if none of the parameters are matched.
This should include otherwise_raise.
Todo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.