def test_identify_standard_known_field(): """ correctly identify that a known standard field exists """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) sfs = jp.getStandardFields(PROJECT_KEY_1, 'Bug') assert "Description" in sfs assert jp.fieldExists(PROJECT_KEY_1, "Bug", "Summary") assert jp.fieldExists(PROJECT_KEY_1, "Story", "Summary") assert jp.fieldExists(PROJECT_KEY_1, "Story", "Status")
def test_sad_bad_project_specfied(): """ raise an error on attempt to identify that a known standard field exists using an invalid project identifier """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) sfs = jp.getStandardFields(PROJECT_KEY_1, 'Bug') assert "Description" in sfs with py.test.raises(Exception) as excinfo: jp.fieldExists(BAD_PROJECT_KEY_1, "Bug", "Summary") actualErrorMessage = excErrorMessage(excinfo) assert 'Could not find project for identifier:' in actualErrorMessage
def test_bug_field_retrieval(): """ check that the Description, Summary and Status fields can be retrieved for a Bug """ #jp = JiraProxy(GOOD_VANILLA_ONDEMAND_REGULAR_USER_CONFIG) jp = JiraProxy(GOOD_VANILLA_ONDEMAND_CONFIG) proj_key = 'JEST' # JIRPA Projet not yet defined in alligator-tiers.atlassian.net sfs = jp.getStandardFields(proj_key, 'Story') # JIRPA as Project not sfs = jp.getStandardFields(proj_key, 'Bug') assert "Description" in sfs assert jp.fieldExists(proj_key, "Bug", "Summary") assert jp.fieldExists(proj_key, "Bug", "Status")
def test_standard_bug_field_presence(): """ should correctly identify that a known standard field exists using a valid project name """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) sfs = jp.getStandardFields(PROJECT_NAME_1, 'Bug') assert "Description" in sfs assert jp.fieldExists(PROJECT_NAME_1, "Bug", "Summary")
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
def test_non_writable_data_fields(): """ recognize standard non-writable date fields """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) sfs = jp.getStandardFields(PROJECT_KEY_1, 'Bug') assert jp.fieldExists(PROJECT_KEY_1, 'Bug', 'created') assert jp.fieldExists(PROJECT_KEY_1, 'Bug', 'CreatedDate') assert jp.fieldExists(PROJECT_KEY_1, 'Bug', 'createddate') assert jp.fieldExists(PROJECT_KEY_1, 'Bug', 'Created Date') assert jp.fieldExists(PROJECT_KEY_1, 'Bug', 'updated') assert jp.fieldExists(PROJECT_KEY_1, 'Bug', 'UpdatedDate') assert jp.fieldExists(PROJECT_KEY_1, 'Bug', 'updateddate') assert jp.fieldExists(PROJECT_KEY_1, 'Bug', 'Updated Date')
def test_detect_bogus_field_does_not_exist(): """ detects that a Bogus field does not exist """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) assert jp.fieldExists(PROJECT_KEY_1, "Bug", 'Bogus') == False