Skip to content

Commit

Permalink
Code review.
Browse files Browse the repository at this point in the history
Ficar atento às várias opções disponibilizadas em

https://docs.python.org/2/library/unittest.html#assert-methods

A principal vantagem é a legibilidade: só de ler o assert você já
entende a lógica ao invés de tentar interpretar a lógica interna que
voltaria True para assertTrue anteriormente.
  • Loading branch information
idgserpro committed May 17, 2018
1 parent 44f5ead commit 7fd8f94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/brasil/gov/portal/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def test_css_upload_before_css_portlet_calendar_first_install(self):
portlet_calendar_css_id = '++resource++calendar_styles/calendar.css'
upload_pos = portal_css.getResourcePosition(upload_css_id)
calendar_pos = portal_css.getResourcePosition(portlet_calendar_css_id)
self.assertTrue(upload_pos < calendar_pos)
self.assertLess(upload_pos, calendar_pos)

def test_upgrade_step_variavel_hidden_profiles_deps_brasil_gov_portal(self): # NOQA
"""
Expand Down
4 changes: 2 additions & 2 deletions src/brasil/gov/portal/tests/test_upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ def test_css_upload_before_css_portlet_calendar(self):
portal_css.moveResourceToBottom(upload_css_id)
upload_pos = portal_css.getResourcePosition(upload_css_id)
calendar_pos = portal_css.getResourcePosition(portlet_calendar_css_id)
self.assertTrue(upload_pos > calendar_pos)
self.assertGreater(upload_pos, calendar_pos)

# execute upgrade step and verify changes were applied
self._do_upgrade(step)
upload_pos = portal_css.getResourcePosition(upload_css_id)
calendar_pos = portal_css.getResourcePosition(portlet_calendar_css_id)
self.assertTrue(upload_pos < calendar_pos)
self.assertLess(upload_pos, calendar_pos)

0 comments on commit 7fd8f94

Please sign in to comment.