def test_look_for_tags_1(self): l = 'Logs: <select id="<%=log%>" name="log" onchange="get_log()">' converter = PSPConverter(None) t = converter._look_for_tags(l) if t[0] != '<%=log%>': msg = 'Not converted right\n' msg += 'Line:%s\n' % l msg += 'After:%s' % t self.fail(msg)
def test_multi_1_replace_tags(self): l = '<td width="50%"><%=node.get()%>Test<%=time.get%></td>' converter = PSPConverter(None) tags = converter._look_for_tags(l) nl = converter._replace_quotes(l) shouldbe = '"<td width="50%">" + str(node.get()) + "Test" + str(time.get) + "</td>\\n"' nl = converter._replace_tags(l,tags) if nl != shouldbe: msg = 'Did not replace tags right\n' msg += 'Original line:%s\n' % l msg += 'new Line:%s\n' % nl msg += 'should be:%s\n' % shouldbe self.fail(msg)