def test_trim_indent(self): res = trim_indent("") assert res == "" res = trim_indent("ab") assert res == "ab" res = trim_indent(os.linesep) assert res == os.linesep
def _get_code_context(self, func): try: source = inspect.getsource(func) source = trim_indent(source) return source except Exception: msg = 'Unable to get code context: ' logger.warning(msg.format(func.__name__)) return ''
def test_trim_multi_blankline(self): res = trim_indent(""" aaaa a aa aaa aaaa aaaaa """) assert res == """aaaa
def test_trim_multi_endsep(self): res = trim_indent(""" aaa """) assert res == """ aaa """ res = trim_indent(""" aaa aaa """) assert res == """aaa aaa """ res = trim_indent(""" aaa aaa """) assert res == """aaa