Tutorials Archives - Arcadiy Ivanov https://www.ivanov.biz/category/tutorials/ Fighting entropy one code line at a time Sun, 19 Jun 2022 19:59:37 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.4 https://www.ivanov.biz/wp-content/uploads/2023/02/cropped-Arcadiy_2141-scaled-e1677291990351-32x32.jpg Tutorials Archives - Arcadiy Ivanov https://www.ivanov.biz/category/tutorials/ 32 32 84149164 How to spy on Mock-wrapped method calls in Python https://www.ivanov.biz/2016/howto-spy-with-python-mock/ https://www.ivanov.biz/2016/howto-spy-with-python-mock/#respond Fri, 01 Apr 2016 22:40:13 +0000 https://www.ivanov.biz/?p=431 You have a class whose API you want to verify: class Class_A(object): def method_X(self): self.method_Y() def method_Y(self): pass You write the following test fully expecting it to pass. Alas, the method_Y assertion fails. def test_class_a(self): obj = Class_A() mock = MagicMock(spec_set=obj, wraps=obj) mock.method_X() mock.method_Y.assert_called_once_with() This is because the Python Unittest Mock, while wrapping mock.method_X(), Mock … Continue reading "How to spy on Mock-wrapped method calls in Python"

The post How to spy on Mock-wrapped method calls in Python appeared first on Arcadiy Ivanov.

]]>
https://www.ivanov.biz/2016/howto-spy-with-python-mock/feed/ 0 431
PicketLink and EARs on WildFly https://www.ivanov.biz/2015/picketlink-and-ears-on-wildfly/ https://www.ivanov.biz/2015/picketlink-and-ears-on-wildfly/#respond Sun, 14 Jun 2015 09:37:34 +0000 https://www.ivanov.biz/?p=381 PicketLink provides a wealth of security functionality, including identity management, federation and authorization in various forms. Unfortunately, WildFly 8.2 with PicketLink 2.7.0.Final suffers from integration issues and documentation gap that makes it very hard to deploy PicketLink in a multi-module enterprise application. The issues discussed below are described ad nauseam in PLINK-666. This guide assumes … Continue reading "PicketLink and EARs on WildFly"

The post PicketLink and EARs on WildFly appeared first on Arcadiy Ivanov.

]]>
https://www.ivanov.biz/2015/picketlink-and-ears-on-wildfly/feed/ 0 381