Exemplo n.º 1
0
def test_name_source_builtin(builtin_use):
    """Test that undefined names are identified."""
    assert name.name_source(builtin_use) is name.NAME_SOURCE.BUILTIN
Exemplo n.º 2
0
def test_name_source_defined(reassign_use):
    """Test that defined names can be identified."""
    assert name.name_source(reassign_use) is name.NAME_SOURCE.DEFINED
Exemplo n.º 3
0
def test_name_source_imported(import_use):
    """Test that import names can be identified."""
    assert name.name_source(import_use) is name.NAME_SOURCE.IMPORTED
Exemplo n.º 4
0
def test_name_source_adopted(return_node, assign_node):
    """Test that adopted names can be identified."""
    assert name.name_source(return_node) is name.NAME_SOURCE.ADOPTED
    assert name.name_source(assign_node) is name.NAME_SOURCE.ADOPTED
Exemplo n.º 5
0
def test_name_source_builtin(builtin_use):
    """Test that undefined names are identified."""
    assert name.name_source(builtin_use) is name.NAME_SOURCE.BUILTIN
Exemplo n.º 6
0
def test_name_source_imported(import_use):
    """Test that import names can be identified."""
    assert name.name_source(import_use) is name.NAME_SOURCE.IMPORTED
Exemplo n.º 7
0
def test_name_source_defined(reassign_use):
    """Test that defined names can be identified."""
    assert name.name_source(reassign_use) is name.NAME_SOURCE.DEFINED
Exemplo n.º 8
0
def test_name_source_adopted(return_node, assign_node):
    """Test that adopted names can be identified."""
    assert name.name_source(return_node) is name.NAME_SOURCE.ADOPTED
    assert name.name_source(assign_node) is name.NAME_SOURCE.ADOPTED