assertTrue(nature != null);
assertTrue(nature.getAstManager() != null);
}
protected void waitForModulesManagerSetup() {
final IModulesManager modulesManager = PythonNature.getPythonNature(mod1).getAstManager().getModulesManager();
goToIdleLoopUntilCondition(
new ICallback<Boolean, Object>() {
public Boolean call(Object arg) {
SortedMap<ModulesKey, ModulesKey> allDirectModulesStartingWith = modulesManager.getAllDirectModulesStartingWith("pack1");
Set<ModulesKey> keySet = allDirectModulesStartingWith.keySet();
HashSet<ModulesKey> expected = new HashSet<ModulesKey>();
expected.add(new ModulesKey("pack1.__init__", null));
expected.add(new ModulesKey("pack1.pack2.__init__", null));
expected.add(new ModulesKey("pack1.pack2.mod1", null));
return expected.equals(keySet);
}
},
new ICallback<String, Object>() {
public String call(Object arg) {
SortedMap<ModulesKey, ModulesKey> allDirectModulesStartingWith = modulesManager
.getAllDirectModulesStartingWith("pack1");
Set<ModulesKey> keySet = allDirectModulesStartingWith.keySet();
return "Found: " + keySet;
}
});