Code review comment for lp:~diegosarmentero/ubuntuone-dev-tools/temp-bytes

Revision history for this message
dobey (dobey) wrote :

62 + def test_check_temp_directory_is_bytes(self):
63 + """Check that the temp-directory value is bytes."""
64 + base_options = runners.BaseTestOptions()
65 + self.assertIsInstance(base_options.optParameters[5][2], str)

Instead of poking at this directly, I think it's probably better to perhaps check that self.tempdir.decode('utf-8') succeeds. If the parameters list changes in the future, your test will break, even when it shouldn't, as it depends on the order of the parameters. Also, I think your test will fail on python3, as the instance of that parameter should be 'bytes' instead of 'str' there at least. It's possible we may need to check the Python version and do things differently on 2 and 3 in the test, as well, but I think the .decode test should be enough for now.

« Back to merge proposal