def test_project_id_contains_non_ascii_character(self): config = copy.copy(CONFIG) config.append(('economic_field', 'custom_field')) jira = Jira(config) fields = { 'id': 1, 'custom_field': '123 — project name', 'other_field': 234 } assert jira.get_project_id(fields) == 123
def test_project_id_as_value_part_of_string(self): config = copy.copy(CONFIG) config.append(('economic_field', 'custom_field')) jira = Jira(config) fields = { 'id': 1, 'custom_field': '123 project name', 'other_field': 234 } assert 123 == jira.get_project_id(fields)
def test_project_id_as_value_part_of_string(self): config = copy.copy(CONFIG) config.append(('economic_field', 'custom_field')) jira = Jira(config) fields = {'id': 1, 'custom_field': '123 project name', 'other_field': 234} assert 123 == jira.get_project_id(fields)
def test_project_id_as_value_multiple_fields_defined(self): config = copy.copy(CONFIG) config.append(('economic_field', 'custom_field,second_field')) jira = Jira(config) fields = {'id': 1, 'custom_field': 123, 'other_field': 234} assert 123 == jira.get_project_id(fields)
def test_project_id_as_dict(self): config = copy.copy(CONFIG) config.append(('economic_field', 'custom_field')) jira = Jira(config) fields = {'id': 1, 'custom_field': {'value': 123}, 'other_field': 234} assert 123 == jira.get_project_id(fields)
def test_project_id_not_in_defined_field(self): config = copy.copy(CONFIG) config.append(('economic_field', 'customfield')) jira = Jira(config) assert jira.get_project_id({}) is False
def test_project_id_as_false_when_no_economic_field_defined(self): config = copy.copy(CONFIG) config.append(('economic_field', '')) jira = Jira(config) assert jira.get_project_id({}) is False
def test_project_id_contains_non_ascii_character(self): config = copy.copy(CONFIG) config.append(('economic_field', 'custom_field')) jira = Jira(config) fields = {'id': 1, 'custom_field': '123 — project name', 'other_field': 234} assert jira.get_project_id(fields) == 123
def test_project_id_does_not_contain_number_value(self): config = copy.copy(CONFIG) config.append(('economic_field', 'custom_field')) jira = Jira(config) fields = {'id': 1, 'custom_field': 'project name', 'other_field': 234} assert jira.get_project_id(fields) is False