INNER CODE UNIT · Python
test_strips_whitespace
connectbot/connectbot · translations/test_translate.py:83
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
# ---------------------------------------------------------------------------
class TestNeedsTranslation:
def test_missing_element_needs_translation(self):
assert needs_translation(None) is True
def test_machine_translated_true_is_skipped(self):
elem = parse(
f'<string xmlns:tools="{TOOLS_NS}" '
f'tools:machine_translated="true" name="x">foo</string>'