Assuming I would like test for a default Apache server response at one point, and I would like to make it platform agnostic.
For CentOS I have:
def test_web_interface(self): self.driver.get(DEST_URL) self.assertIn('Apache HTTP Server Test Page powered by CentOS', self.driver.title)
for Debian I have:
def test_web_interface(self): self.driver.get(DEST_URL) self.assertIn('Apache2 Debian Default Page: It works', self.driver.title)
The assertion string is the only difference in two tests.
If I would like to avoid passing the "tested platform"-argument to the test, apart from checking the common string like
Page, what would be a canonical way of including a disjunction inside such a unit test?