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
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')
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) : assertEquals( len(SongFormat. get_format_ list()) , len(SongFormat. __attributes_ _))
self.
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 assertEquals( len(SongFormat. get_format_ list()) , len(SongFormat. __attributes_ _), 'The correct number of attributes have not been created')
self.