Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/344725 )
Change subject: Fix dictionary comparison ...................................................................... Fix dictionary comparison Oops! sorted(dict) was just leaving us with the keys Change-Id: I9827b9fcdd62549583dd54031589306542c1f39b --- M audit/paypal/tests/test_trr_file.py 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/25/344725/1 diff --git a/audit/paypal/tests/test_trr_file.py b/audit/paypal/tests/test_trr_file.py index 2cf3c3e..00ed5b7 100644 --- a/audit/paypal/tests/test_trr_file.py +++ b/audit/paypal/tests/test_trr_file.py @@ -135,9 +135,9 @@ # Did we send it? args = MockRedis().send.call_args assert args[0][0] == 'refund' - expected = sorted({'last_name': 'Man', 'thankyou_date': 0, 'city': '', 'payment_method': '', 'gateway_status': 'S', 'currency': 'USD', 'postal_code': '', 'date': '1474736101', 'gateway_refund_id': 'AS7D98AS7D9A8S7D9AS', 'gateway': 'paypal', 'state_province': '', 'gross': 10.0, 'first_name': 'Banana', 'fee': 0.55, 'gateway_txn_id': 'AS7D98AS7D9A8S7D9AS', 'gross_currency': 'USD', 'country': '', 'payment_submethod': '', 'note': 'r', 'supplemental_address_1': '', 'settled_date': '1474736101', 'gateway_parent_id': '3GJH3GJ3334214812', 'type': 'refund', 'email': 'pranks...@anonymous.net', 'street_address': '', 'contribution_tracking_id': '1234567', 'order_id': '1234567'}) - actual = sorted(args[0][1]) - assert actual == expected + expected = {'last_name': 'Man', 'thankyou_date': 0, 'city': '', 'payment_method': '', 'gateway_status': 'S', 'currency': 'USD', 'postal_code': '', 'date': '1474736101', 'gateway_refund_id': 'AS7D98AS7D9A8S7D9AS', 'gateway': 'paypal', 'state_province': '', 'gross': 10.0, 'first_name': 'Banana', 'fee': 0.55, 'gateway_txn_id': 'AS7D98AS7D9A8S7D9AS', 'gross_currency': 'USD', 'country': '', 'payment_submethod': '', 'note': 'r', 'supplemental_address_1': '', 'settled_date': '1474736101', 'gateway_parent_id': '3GJH3GJ3334214812', 'type': 'refund', 'email': 'pranks...@anonymous.net', 'street_address': '', 'contribution_tracking_id': '1234567', 'order_id': '1234567'} + actual = args[0][1] + assert cmp(actual, expected) == 0 @patch("queue.redis_wrap.Redis") @@ -175,6 +175,6 @@ # Did we send it? args = MockRedis().send.call_args assert args[0][0] == 'recurring' - expected = sorted({'last_name': 'Man', 'txn_type': 'subscr_payment', 'thankyou_date': 0, 'city': '', 'payment_method': '', 'gateway_status': 'S', 'currency': 'USD', 'postal_code': '', 'date': '1474736101', 'subscr_id': '3GJH3GJ3334214812', 'gateway': 'paypal', 'state_province': '', 'gross': 0.1, 'first_name': 'Banana', 'fee': 0.55, 'gateway_txn_id': 'AS7D98AS7D9A8S7D9AS', 'country': '', 'payment_submethod': '', 'note': '', 'supplemental_address_1': '', 'settled_date': '1474736101', 'email': 'pranks...@anonymous.net', 'street_address': '', 'contribution_tracking_id': '1234567', 'order_id': '1234567'}) - actual = sorted(args[0][1]) - assert actual == expected + expected = {'last_name': 'Man', 'txn_type': 'subscr_payment', 'thankyou_date': 0, 'city': '', 'payment_method': '', 'gateway_status': 'S', 'currency': 'USD', 'postal_code': '', 'date': '1474736101', 'subscr_id': '3GJH3GJ3334214812', 'gateway': 'paypal', 'state_province': '', 'gross': 0.1, 'first_name': 'Banana', 'fee': 0.55, 'gateway_txn_id': 'AS7D98AS7D9A8S7D9AS', 'country': '', 'payment_submethod': '', 'note': '', 'supplemental_address_1': '', 'settled_date': '1474736101', 'email': 'pranks...@anonymous.net', 'street_address': '', 'contribution_tracking_id': '1234567', 'order_id': '1234567'} + actual = args[0][1] + assert cmp(actual, expected) == 0 -- To view, visit https://gerrit.wikimedia.org/r/344725 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9827b9fcdd62549583dd54031589306542c1f39b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: master Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits