From c22c81304ff616a4b4345d4e648f1e61dc10d2cc Mon Sep 17 00:00:00 2001 From: Jochen Breuer Date: Wed, 11 Apr 2018 10:46:00 +0200 Subject: [PATCH] Test is now also working with Python2 Since assertCountEqual was Python>=3.2 only, we backported this to Python2. --- tests/unit/grains/test_core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py index 6d46414238..abf5617ee7 100644 --- a/tests/unit/grains/test_core.py +++ b/tests/unit/grains/test_core.py @@ -889,4 +889,6 @@ SwapTotal: 4789244 kB''' ret = {'fqdns': ['bluesniff.foo.bar', 'foo.bar.baz', 'rinzler.evil-corp.com']} with patch.object(socket, 'gethostbyaddr', side_effect=reverse_resolv_mock): fqdns = core.fqdns() - self.assertCountEqual(fqdns['fqdns'], ret['fqdns']) + self.assertIn('fqdns', fqdns) + self.assertEqual(len(fqdns['fqdns']), len(ret['fqdns'])) + self.assertEqual(set(fqdns['fqdns']), set(ret['fqdns']))