def test_close_layer(self): stack = [] l1, l2, l3 = layer.Layer(stack), layer.Layer(stack), layer.Layer(stack) l1.tags, l1.text = {tag_m}, '...' l2.tags, l2.text = {tag_i}, ',,,' l3.tags, l3.text = {tag_p, tag_s}, '+++' expected = [] l1, l2 = layer.Layer(expected), layer.Layer(expected) l1.tags, l1.text = {tag_m}, '...' l2.tags, l2.text = {tag_i}, ',,,[%s][%s]+++[/%s][/%s]' % ( tag_p.opening, tag_s.opening, tag_s.closing, tag_p.closing) layer.close_layer(stack) self.assertEqual(expected, stack)
def test_close_layer(self): stack = [] l1, l2, l3 = layer.Layer(stack), layer.Layer(stack), layer.Layer(stack) l1.tags, l1.text = {tag_m}, "..." l2.tags, l2.text = {tag_i}, ",,," l3.tags, l3.text = {tag_p, tag_s}, "+++" expected = [] l1, l2 = layer.Layer(expected), layer.Layer(expected) l1.tags, l1.text = {tag_m}, "..." l2.tags = {tag_i} l2.text = f",,,[{tag_p.opening}][{tag_s.opening}]" \ f"+++[/{tag_s.closing}][/{tag_p.closing}]" layer.close_layer(stack) self.assertEqual(expected, stack)