def test_marks_module_as_squashed(self): graph = ImportGraph() modules_to_squash = { "foo", "foo.green", } for module in modules_to_squash: graph.add_module(module) graph.squash_module("foo") assert graph.is_module_squashed("foo")
def test_returns_false_for_module_added_without_is_squashed(self): graph = ImportGraph() graph.add_module("foo", is_squashed=False) assert not graph.is_module_squashed("foo")
def test_raises_module_not_present_for_nonexistent_module(self): graph = ImportGraph() with pytest.raises(ModuleNotPresent): assert not graph.is_module_squashed("foo")
def test_returns_true_for_module_added_with_is_squashed(self): graph = ImportGraph() graph.add_module("foo", is_squashed=True) assert graph.is_module_squashed("foo")