INNER CODE UNIT · Python

test_stops_at_intervening_element

connectbot/connectbot · translations/test_translate.py:74

    def test_stops_at_intervening_element(self):
        root = resources_elem(
            '<!-- Old comment -->\n'
            '<string name="other">Other</string>\n'
            '<string name="title">Hello</string>'
        )
        elem = root.findall("string")[1]
        assert preceding_comment(elem) == ""

    def test_strips_whitespace(self):
        root = resources_elem('<!--   padded comment   -->\n<string name="x">X</string>')
        elem = root.find("string")
        assert preceding_comment(elem) == "padded comment"


# ---------------------------------------------------------------------------
# needs_translation
# ---------------------------------------------------------------------------

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…