Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Elegant assertions library.
This is currently a work in progress.
pip install expecting
poetry add expecting --group dev
Expecting consists of a set of assertion objects that can be used with assert
statements in a clear, readable way.
Most common assertion will be covered under a structured set of modules, following an intuitive naming schema:
import expecting
assert '2023-10-11' == expecting.string.datetime.iso8601_day()
Here, the expcting.string.datetime
module introduces a handful of factory methods for asserting that the value is a
string representing a date and time format.
It's specially useful with pytest and its amazing error messages, where an assertion failure message would look something like:
string/test_datetime.py:7 (test_iso8601_full_matches[2023/10/11 13:01:10])
'2023/10/11 13:01:10' != ~= <datetime as "%Y-%m-%dT%H:%M:%S.%f%z">
Expected :~= <datetime as "%Y-%m-%dT%H:%M:%S.%f%z">
Actual :'2023/10/11 13:01:10'
<Click to see difference>
datetime_str = '2023/10/11 13:01:10'
@pytest.mark.parametrize(
'datetime_str',
(
'2023/10/11 13:01:10',
)
)
def test_iso8601_full_matches(datetime_str: str):
> assert datetime_str == expecting.string.datetime.iso8601_full()
E assert '2023/10/11 13:01:10' == ~= <datetime as "%Y-%m-%dT%H:%M:%S.%f%z">
...
The ~=
symbol prefixing the expected value is used denote this value is an "expecting object".
Feel free to create issues or merge requests with any improvement or fix you might find useful.
FAQs
Elegant assertions library
We found that expecting 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.