stratis-storage/stratis-cli

Remove redundant pairs from stratisd_cert.py

Closed this issue · 0 comments

There are instances of pairs of checks like this:

self.assertisInstance(result, list)
self.assertEqual(result, [])

the first line in the pair is redundant, because [] is an instance of list.

Formally, if result == [] then isinstance(result, list). And if not isinstance(result, list) then result != [].

So, the assertIsInstance check is redundant in pairs like this, and can be removed. Note also that the equality check will give the more informative answer if it fails, it would be a shame for the instance check to fail and give a less informative answer.