New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

assertpy

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assertpy - pypi Package Compare versions

Comparing version
1.0
to
1.1
+1
-1
assertpy/assertpy.py

@@ -52,3 +52,3 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__version__ = '1.0'
__version__ = '1.1'

@@ -55,0 +55,0 @@ __tracebackhide__ = True # clean tracebacks via py.test integration

@@ -29,3 +29,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class BaseMixin(object):

@@ -89,2 +91,5 @@ """Base mixin."""

# ignore nested keys
assert_that({'a': {'b': 2, 'c': 3, 'd': 4}}).is_equal_to({'a': {'d': 4}}, ignore=[('a', 'b'), ('a', 'c')])
When the val is *dict-like*, only certain keys can be *included* when checking equality::

@@ -91,0 +96,0 @@

@@ -37,3 +37,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class CollectionMixin(object):

@@ -40,0 +42,0 @@ """Collection assertions mixin."""

@@ -38,3 +38,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class ContainsMixin(object):

@@ -41,0 +43,0 @@ """Containment assertions mixin."""

@@ -31,3 +31,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class DateMixin(object):

@@ -34,0 +36,0 @@ """Date and time assertions mixin."""

@@ -29,3 +29,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class DictMixin(object):

@@ -32,0 +34,0 @@ """Dict assertions mixin."""

@@ -37,3 +37,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class DynamicMixin(object):

@@ -97,6 +99,6 @@ """Dynamic assertions mixin.

try:
if is_dict:
val_attr = self.val[attr_name]
else:
val_attr = getattr(self.val, attr_name)
except AttributeError:
val_attr = self.val[attr_name]

@@ -103,0 +105,0 @@ if callable(val_attr):

@@ -37,3 +37,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class ExceptionMixin(object):

@@ -40,0 +42,0 @@ """Expected exception mixin."""

@@ -39,3 +39,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class ExtractingMixin(object):

@@ -42,0 +44,0 @@ """Collection flattening mixin.

@@ -37,3 +37,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
def contents_of(file, encoding='utf-8'):

@@ -40,0 +42,0 @@ """Helper to read the contents of the given file or path into a string with the given encoding.

@@ -39,3 +39,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class HelpersMixin(object):

@@ -171,2 +173,3 @@ """Helpers mixin. For internal use only."""

# calc val keys given ignores and includes
if ignore and include:

@@ -179,2 +182,3 @@ k1 = set([k for k in val if k not in ignores and k in includes])

# calc other keys given ignores and includes
if ignore and include:

@@ -188,9 +192,9 @@ k2 = set([k for k in other if k not in ignores and k in includes])

if k1 != k2:
# different set of keys, so not equal
return True
else:
for k in k1:
if self._check_dict_like(
val[k], check_values=False, return_as_bool=True) and self._check_dict_like(
other[k], check_values=False, return_as_bool=True):
return self._dict_not_equal(
if self._check_dict_like(val[k], check_values=False, return_as_bool=True) and \
self._check_dict_like(other[k], check_values=False, return_as_bool=True):
subdicts_not_equal = self._dict_not_equal(
val[k],

@@ -200,3 +204,7 @@ other[k],

include=[i[1:] for i in self._dict_ignore(include) if type(i) is tuple and i[0] == k] if include else None)
if subdicts_not_equal:
# fast fail inside the loop since sub-dicts are not equal
return True
elif val[k] != other[k]:
# fast fail inside the loop since values are not equal
return True

@@ -220,3 +228,3 @@ return False

ellip = False
for k, v in d.items():
for k, v in sorted(d.items()):
if k not in other:

@@ -223,0 +231,0 @@ out += '%s%s: %s' % (', ' if len(out) > 0 else '', repr(k), repr(v))

@@ -35,3 +35,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class NumericMixin(object):

@@ -38,0 +40,0 @@ """Numeric assertions mixin."""

@@ -35,3 +35,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class SnapshotMixin(object):

@@ -71,3 +73,3 @@ """Snapshot mixin.

Important:
Note:
Snapshots require Python 3.x

@@ -74,0 +76,0 @@ """

@@ -42,3 +42,5 @@ # Copyright (c) 2015-2019, Activision Publishing, Inc.

__tracebackhide__ = True
class StringMixin(object):

@@ -45,0 +47,0 @@ """String assertions mixin."""

Metadata-Version: 1.1
Name: assertpy
Version: 1.0
Version: 1.1
Summary: Simple assertion library for unit testing in python with a fluent API

@@ -9,3 +9,3 @@ Home-page: https://github.com/assertpy/assertpy

License: BSD
Download-URL: https://github.com/assertpy/assertpy/archive/1.0.tar.gz
Download-URL: https://github.com/assertpy/assertpy/archive/1.1.tar.gz
Description:

@@ -12,0 +12,0 @@ assertpy