def test_forcePushCaseversion(self): # add test data for forcePushCaseversion test_case_obj = mtapi.MozTrapTestCase(self.test_case_sample_2['name'], config.defaultProduct, config.defaultVersion) for step in self.test_case_sample_2['steps']: test_case_obj.add_step(step['instruction'], step['expected']) resp = test_case_obj.create() # get the response obj from creating the case obj and pass to forcePushCaseVersion # test the forcePushCaseversion can update data correctly with id mtapi.forcePushCaseversion(self.test_case_sample_3, { 'username': mz_user_name, 'api_key': mz_user_api_key }, case_version_id=resp['id']) # test the forcePushCaseversion can update data correctly with case name self.test_case_sample_3['description'] = "Test update desc" self.test_case_sample_3['steps'] = [{ "expected": "Oh ya mom I'm on TV~~~", "instruction": "test another condition for forcepush", "number": 1 }] mtapi.forcePushCaseversion(self.test_case_sample_3, { 'username': mz_user_name, 'api_key': mz_user_api_key })
def test_forcePushCaseversion(self): #BODY = "***filecontents***" #conn = Mock(httplib.HTTPConnection("localhost", 8080)) #conn.request("PUT", "/file", BODY) #response = conn.getresponse() #print response.status, response.reason mock_conn = mock.Mock(spec=requests) mtapi.forcePushCaseversion(self.json_out, mock_conn) # mock_conn.assert_called_with(mtapi.mtorigin) mock_conn.put.assert_called_with(mtapi.mtorigin, data=json.dumps(self.json_out))
def test_forcePushCaseversion(self): # add test data for forcePushCaseversion test_case_obj = mtapi.MozTrapTestCase(self.test_case_sample_2['name'], config.defaultProduct, config.defaultVersion) for step in self.test_case_sample_2['steps']: test_case_obj.add_step(step['instruction'], step['expected']) resp = test_case_obj.create() # get the response obj from creating the case obj and pass to forcePushCaseVersion # test the forcePushCaseversion can update data correctly with id mtapi.forcePushCaseversion(self.test_case_sample_3, {'username': mz_user_name, 'api_key': mz_user_api_key}, case_version_id=resp['id']) # test the forcePushCaseversion can update data correctly with case name self.test_case_sample_3['description'] = "Test update desc" self.test_case_sample_3['steps'] = [{"expected": "Oh ya mom I'm on TV~~~", "instruction": "test another condition for forcepush", "number": 1}] mtapi.forcePushCaseversion(self.test_case_sample_3, {'username': mz_user_name, 'api_key': mz_user_api_key})