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.
Worth is a Python library that helps you assert relevant object attributes
For example
from worth import Omit
def test_something_like():
a = Model(id=12345, name="Hoff")
b = Model(id=67890, name="Hoff")
assert a == b | Omit("id")
It implements some helpers
Always
Always()
assertion is always true.
assert "a string" == Always()
assert 42 == Always()
assert False == Always()
Never
Never()
assertion is always false.
assert "a string" == Never()
assert 42 == Never()
assert False == Never()
OneOf
OneOf()
asserts one of its values.
assert "foo" == OneOf("foo", "bar")
assert "bar" == OneOf("foo", "bar")
assert "qux" != OneOf("foo", "bar")
Things that applies to models (dataclasses, attrs, or msgspec)
Omit
Omit()
let you to exclude some properties of you model from the comparison.
a = Model(id=12345, name="Hoff")
b = Model(id=67890, name="Hoff")
assert a == b | Omit("id")
Only
Only()
let you to choose precisely which properties you want to compair.
a = Model(id=12345, name="Hoff")
b = Model(id=67890, name="Hoff")
assert a == b | Only("name")
Things that applies to mappings
contains
contains()
let you to compare some mapping items.
assert {"foo": 42, "bar": True} == contains({"foo": 42})
assert {"foo": 42, "bar": True} != contains({"foo": "wrong"})
FAQs
Assert relevant object attributes
We found that worth 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.