Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Stupidly-simple python mocking utility with moxie.
|BuildImage|_
.. image:: https://pypip.in/v/mocksey/badge.png :target: https://crate.io/packages/mocksey/ :alt: Latest PyPI version
.. image:: https://pypip.in/d/mocksey/badge.png :target: https://crate.io/packages/mocksey/ :alt: Number of PyPI downloads
|Coverage Status|
.. |Coverage Status| image:: https://coveralls.io/repos/mitgr81/mocksey/badge.png :target: https://coveralls.io/r/mitgr81/mocksey
I was teaching a class on unit testing to a group of co-workers who were familiar with Simple Test for PHP <http://www.simpletest.org/>
_ so I hacked together what is becoming Mocksey.
Mocksey the TDD'd version of that TDD utilty. It's so meta even this acronym <http://xkcd.com/917/>
_.
Either find mocksey on PyPI_ or install it with pip or easy_install ::
pip install mocksey #or easy_install mocksey
It's pretty simple. Create a mocked object with generate_mock, inject it (or monkey patch) and set up your assertions. After your function call(s), simply call 'run_asserts' and win!
The unit tests are a pretty decent working example.
Tweaksey is a collection of beautification wrappers. Currently there's only one around mock_, but there may be more in the future. It'll look best if you also have nose_ installed, and may only be worth it in that case, actually. Anyhow, to use it simply import tweaksey from mocksey and get your copy of the mock package from tweaksey.tweak_mock
. Your mock assertions should now have a touch more friendliness. If there are more you'd like to add, go for it! Michael Foord, if you want to take the output and run, that cool too (conversely, if you don't like that I did this, I'll kill it square dead).
Mocksey now sets nose to full diff mode.
Tweaksey now requires you to pass in the 'mock' library that you're
tweaking. This allows one to apply mocks to python3's unittest.mock
.
This software is hereby released under the MIT License, as seen in the LICENSE file
.. |BuildImage| image:: https://secure.travis-ci.org/mitgr81/mocksey.png .. _BuildImage: https://travis-ci.org/mitgr81/mocksey .. _PyPI: http://pypi.python.org/pypi/mocksey .. _mock: http://www.voidspace.org.uk/python/mock/ .. _nose: https://pypi.python.org/pypi/nose/
FAQs
Stupidly-simple python mocking utility with moxie.
We found that mocksey demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.