def page_render(self, expected, resource, view_type): """See self.test_page_render""" page = Page('testPage', resource, view_type) page.add_attributes({'title': "Welcome", 'name': 'pyTiles'}) result = page.render() print("Using View Type: {0}".format(view_type.__class__)) print("Expected: {0}".format(expected)) print(" Got: {0}".format(result)) self.assertTrue(result == expected)
def test_page_add_attributes(self): """Test adding attributes to a Page.""" expected = {'eat':"spam & eggs", 'drink':"good ol' h2O"} page = Page('testPage', None, None) page.add_attributes({'eat':"spam & eggs"}) page.add_attributes({'drink':"good ol' h2O"}) result = page.attributes print("Expected: {0}".format(expected)) print(" Got: {0}".format(result)) self.assertTrue(result == expected)