Beispiel #1
0
def test_remove_imports_in_function():
    result = remove_imports(TEST_SOURCE_3)
    # test function should have 3 lines (including the comment)
    assert len(result.split('\n')[1:-1]) == 3
    assert 'def foo():' in result
    assert '# a comment in a function' in result
    assert 'bar()' in result
Beispiel #2
0
def test_remove_imports_in_function():
    result = remove_imports(TEST_SOURCE_3)
    # test function should have 3 lines (including the comment)
    assert len(result.split('\n')[1:-1]) == 3
    assert 'def foo():' in result
    assert '# a comment in a function' in result
    assert 'bar()' in result
Beispiel #3
0
def test_remove_imports():
    result = remove_imports(TEST_SOURCE_2)
    assert 'foo_bar()' in result
Beispiel #4
0
def test_remove_imports():
    result = remove_imports(TEST_SOURCE_2)
    assert 'foo_bar()' in result