void (boolean hasFile, boolean hasCall, boolean requires, boolean extrasRequire) { final Module module = myFixture.getModule(); if (hasFile) { assertTrue(PyPackageUtil.hasSetupPy(module)); final PyFile setupPy = PyPackageUtil.findSetupPy(module); assertNotNull(setupPy); if (hasCall) { assertNotNull(PyPackageUtil.findSetupCall(module)); if (requires) { checkRequirements(PyPackageUtil.findSetupPyRequires(module)); } else { final List<PyRequirement> requirements = PyPackageUtil.findSetupPyRequires(module); assertNotNull(requirements); assertEmpty(requirements); } if (extrasRequire) { final Map<String, List<PyRequirement>> extrasRequirements = PyPackageUtil.findSetupPyExtrasRequire(module); final ImmutableMap<String, List<PyRequirement>> expected = ImmutableMap.of( "e1", Collections.singletonList(PyRequirementsKt.pyRequirement("r1")), "e2", Collections.singletonList(PyRequirementsKt.pyRequirement("r2")), "e3", Arrays.asList(PyRequirementsKt.pyRequirement("r3"), PyRequirementsKt.pyRequirement("r4")) ); assertEquals(expected, extrasRequirements); } else { assertNull(PyPackageUtil.findSetupPyExtrasRequire(module)); } } else { assertNull(PyPackageUtil.findSetupCall(module)); assertNull(PyPackageUtil.findSetupPyRequires(module)); } } else { assertFalse(PyPackageUtil.hasSetupPy(module)); assertNull(PyPackageUtil.findSetupPy(module)); assertNull(PyPackageUtil.findSetupCall(module)); assertNull(PyPackageUtil.findSetupPyRequires(module)); } }