Code review comment for lp:~thelinuxguy/openlp/fix-1490184

Revision history for this message
Tim Bentley (trb143) wrote :

Four new tests is great but we do have a style about our tests.
All the tests are based around the simple structure. Note the comments are very important as they are the only part of the test visible when it fails so it give a clue where to look

# GIVEN:

# WHEN:

# THEN:

so

def test_get_format_list(self):
   self.assertEquals(len(SongFormat.get_format_list()), len(SongFormat.__attributes__))

becomes something like.

def test_get_format_list(self):
   """
   Test for default format list
   """
   # GIVEN: a SongFormat

   # WHEN: I have a basic object

   # THEN: the following data should be constructed
   self.assertEquals(len(SongFormat.get_format_list()), len(SongFormat.__attributes__), 'The correct number of attributes have not been created')

review: Needs Fixing

« Back to merge proposal