There's some trailing whitespace in ftpmaster.py. There are some other
lint warnings (especially from pep8) but I don't know if any of them
are related to your changes. If you have time, consider fixing them,
but don't worry too much.
[2]
+ # Strip trailing newline
+ return changes
I think that comment can go.
[3]
+ self.assertFalse("Description" in changes)
+ self.assertFalse("Closes" in changes)
+ self.assertFalse("Launchpad-bugs-fixed" in changes)
...
+ self.assertFalse("Launchpad-bugs-fixed" in changes)
If you were to switch the base class from unittest.TestCase to
lp.testing.TestCase (or testtools.TestCase, its parent) then you could
use assertNotIn() in these places.
[4]
+ self.assertTrue(
+ contents.find("Updated French translation by J\xc3\xa9lmer."))
I think this would be clearer as:
self.assertTrue( "Updated French translation by J\xc3\xa9lmer." in contents)
Or, better:
self.assertIn( "Updated French translation by J\xc3\xa9lmer.", contents)
[5]
filehandle = open(output_filename, 'w')
- # XXX cprov 2007-07-03: The Soyuz .changes parser requires the extra '\n'
- filehandle.write(changes+'\n')
- filehandle.close()
+ try:
+ changes.dump(filehandle, encoding="utf-8")
+ finally:
+ filehandle.close()
Nice branch :)
A few comments, but they're all minor. +1
[1]
There's some trailing whitespace in ftpmaster.py. There are some other
lint warnings (especially from pep8) but I don't know if any of them
are related to your changes. If you have time, consider fixing them,
but don't worry too much.
[2]
+ # Strip trailing newline
+ return changes
I think that comment can go.
[3]
+ self.assertFals e("Description" in changes) e("Closes" in changes) e("Launchpad- bugs-fixed" in changes) e("Launchpad- bugs-fixed" in changes)
+ self.assertFals
+ self.assertFals
...
+ self.assertFals
If you were to switch the base class from unittest.TestCase to
lp.testing.TestCase (or testtools.TestCase, its parent) then you could
use assertNotIn() in these places.
[4]
+ self.assertTrue( find("Updated French translation by J\xc3\xa9lmer."))
+ contents.
I think this would be clearer as:
Or, better:
[5]
filehandle = open(output_ filename, 'w') write(changes+ '\n') dump(filehandle , encoding="utf-8")
- # XXX cprov 2007-07-03: The Soyuz .changes parser requires the extra '\n'
- filehandle.
- filehandle.close()
+ try:
+ changes.
+ finally:
+ filehandle.close()
Consider using "with" here.