def test_failed_upload(self, mock_popen): mock_popen.return_value.stdout.readline.return_value = '' mock_popen.return_value.returncode = 1 empDep = EmpiarDepositor("ABC123", "tests/deposition_json/working_example.json", "", "", entry_id=1, entry_directory='DIR') with self.assertRaises(SystemExit) as cm: c = empDep.aspera_upload() self.assertEqual(cm.exception.args[0], 1)
def test_failed_upload(self, mock_popen): mock_popen.return_value.stdout.readline.return_value = b'' mock_popen.return_value.returncode = 1 emp_dep = EmpiarDepositor("ABC123", self.json_path, "", "ascp", entry_id=1, entry_directory='DIR') c = emp_dep.aspera_upload() self.assertEqual(c, 1)