def test_str_repr(self): spa = SPA(self.benchmark, self.models) expected = 'SPA(studentization: asymptotic, bootstrap: ' + \ str(spa.bootstrap) + ')' assert_equal(str(spa), expected) expected = expected[:-1] + ', ID: ' + hex(id(spa)) + ')' assert_equal(spa.__repr__(), expected) expected = ('<strong>SPA</strong>(' + '<strong>studentization</strong>: asymptotic, ' + '<strong>bootstrap</strong>: ' + str(spa.bootstrap) + ', <strong>ID</strong>: ' + hex(id(spa)) + ')') assert_equal(spa._repr_html_(), expected) spa = SPA(self.benchmark, self.models, studentize=False, bootstrap='cbb') expected = 'SPA(studentization: none, bootstrap: ' + \ str(spa.bootstrap) + ')' assert_equal(str(spa), expected) spa = SPA(self.benchmark, self.models, nested=True, bootstrap='moving_block') expected = 'SPA(studentization: bootstrap, bootstrap: ' + \ str(spa.bootstrap) + ')' assert_equal(str(spa), expected)
def test_str_repr(spa_data): spa = SPA(spa_data.benchmark, spa_data.models) expected = "SPA(studentization: asymptotic, bootstrap: " + str( spa.bootstrap) + ")" assert_equal(str(spa), expected) expected = expected[:-1] + ", ID: " + hex(id(spa)) + ")" assert_equal(spa.__repr__(), expected) expected = ("<strong>SPA</strong>(" + "<strong>studentization</strong>: asymptotic, " + "<strong>bootstrap</strong>: " + str(spa.bootstrap) + ", <strong>ID</strong>: " + hex(id(spa)) + ")") assert_equal(spa._repr_html_(), expected) spa = SPA(spa_data.benchmark, spa_data.models, studentize=False, bootstrap="cbb") expected = "SPA(studentization: none, bootstrap: " + str( spa.bootstrap) + ")" assert_equal(str(spa), expected) spa = SPA(spa_data.benchmark, spa_data.models, nested=True, bootstrap="moving_block") expected = "SPA(studentization: bootstrap, bootstrap: " + str( spa.bootstrap) + ")" assert_equal(str(spa), expected)