def test_name_token(): assert _get_tokens([]) == [] for processor in processors: tokens = _get_tokens(['aragorn']) tokens = processor(tokens) text = untokenize(tokens) assert text == 'aragorn'
def test_no_tokens(): assert _get_tokens([]) == [] for processor in processors: assert processor([]) == []
def test_extract_class_name(): tokens = _get_tokens(['class LOL', 'pass']) tokens = _extract_def_name(tokens) text = untokenize(tokens) assert text.lstrip() == 'LOL'
def test_extract_decorator_args_no_call(): tokens = _get_tokens(['@deal.safe']) tokens = _extract_decorator_args(tokens) text = untokenize(tokens) assert text == ' deal.safe'
def test_extract_lambda_body_no_lambda(): tokens = _get_tokens(['lambda x']) tokens = _extract_lambda_body(tokens) text = untokenize(tokens) assert text == 'lambda x'
def test_extract_assignment_no_assigment(): tokens = _get_tokens(['aragorn']) tokens = _extract_assignment(tokens) text = untokenize(tokens) assert text == 'aragorn'