Пример #1
0
 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
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 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)
Пример #6
0
 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
Пример #7
0
 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
Пример #8
0
 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
Пример #9
0
 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
Пример #10
0
 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)
Пример #11
0
 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)
Пример #12
0
 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
Пример #13
0
 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
Пример #14
0
 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