def test_valid_project_has_custom_fields(): """ should correctly identify that a known custom field exists for a valid project name """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) cfs = jp.getCustomFields(PROJECT_NAME_1, 'Bug') assert "RallyItem" in cfs assert jp.fieldExists(PROJECT_NAME_1, "Bug", "RallyID") jp2 = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) assert jp2.isCustomField(PROJECT_NAME_1, "Bug", "RallyURL")
def test_for_known_custom_field(): """ correctly identify that a known custom field exists """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) cfs = jp.getCustomFields(PROJECT_KEY_1, 'Bug') assert "RallyItem" in cfs assert jp.fieldExists(PROJECT_KEY_1, "Bug", "RallyID") jp2 = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) assert jp2.isCustomField(PROJECT_KEY_1, "Bug", "RallyURL")
def test_sad_bad_project_prevents_seeing_custom_field(): """ raises an error on attempt to identify that a known custom field exists with an invalid project identifier """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) cfs = jp.getCustomFields(PROJECT_KEY_1, 'Bug') assert "RallyItem" in cfs assert jp.fieldExists(PROJECT_KEY_1, "Bug", "RallyID") with py.test.raises(JiraProxyError) as excinfo: trvth = jp.isCustomField(BAD_PROJECT_KEY_1, "Bug", "RallyURL") actualErrorMessage = excErrorMessage(excinfo) assert 'Could not find project for identifier:' in actualErrorMessage