Ejemplo n.º 1
0
def test_should_module_be_included_no_intersecting_members(mock_get_members):
    """Test that should_module_be_included returns False when despite files
    in common there are no members in common"""
    mock_get_members.return_value = {"one.py": ImportSet("one.py", False, {"func_one"})}
    mock_involved = frozenset([("one.py", ImportSet("one.py", False, {"func_two"}))])

    assert not should_module_be_included(mock.Mock(), mock_involved)
Ejemplo n.º 2
0
def test_should_module_be_included_incorrect_module(mock_get_members):
    """Tests that should_module_be_included returns False for a module
    importing the correct module"""
    mock_get_members.return_value = {"one.py": ImportSet("one.py", True)}
    mock_involved = frozenset([("two.py", ImportSet("two.py", True))])

    assert not should_module_be_included(mock.Mock(), mock_involved)
Ejemplo n.º 3
0
def test_should_module_be_included_no_imported_members_but_whole_module(
    mock_get_members
):
    """Test that should_module_be_included returns True when there are no
    members in common but the entire module is specified as an involved file.
    """
    mock_get_members.return_value = {"one.py": ImportSet("one.py", False, {"func_one"})}
    mock_involved = frozenset([("one.py", ImportSet("one.py", True, {"func_two"}))])

    assert should_module_be_included(mock.Mock(), mock_involved)