Exemplo n.º 1
0
 def test_file_attach(self, mock_new_resource, mock_open):
     fd = open("tests/resources/tasks_list_success.json")
     mock_open.return_value = fd
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     issue = Issue(rm, id=1, project=1)
     issue.attach("tests/resources/tasks_list_success.json")
     mock_new_resource.assert_called_with(files={"attached_file": fd}, payload={"project": 1, "object_id": 1})
Exemplo n.º 2
0
 def test_file_attach(self, mock_new_resource, mock_open):
     fd = open("tests/resources/tasks_list_success.json")
     mock_open.return_value = fd
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     issue = Issue(rm, id=1, project=1)
     issue.attach("tests/resources/tasks_list_success.json")
     mock_new_resource.assert_called_with(files={"attached_file": fd}, payload={"project": 1, "object_id": 1})
Exemplo n.º 3
0
 def test_open_file_attach(self, mock_new_resource):
     fd = open('tests/resources/tasks_list_success.json')
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     issue = Issue(rm, id=1, project=1)
     issue.attach(fd)
     mock_new_resource.assert_called_with(
         files={'attached_file': fd},
         payload={'project': 1, 'object_id': 1}
     )