Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 3
0
def test_remove_imports():
    result = remove_imports(TEST_SOURCE_2)
    assert 'foo_bar()' in result
Exemplo n.º 4
0
def test_remove_imports():
    result = remove_imports(TEST_SOURCE_2)
    assert 'foo_bar()' in result