Skip to content
Snippets Groups Projects
Commit 44312f81 authored by vuillaut's avatar vuillaut
Browse files

actually write in the file

parent 9397e225
No related branches found
No related tags found
1 merge request!57eossr upload unique function
Pipeline #138398 failed
......@@ -5,6 +5,7 @@ import pytest
import subprocess
import pkg_resources
import os
from pathlib import Path
import tempfile
from os.path import dirname, realpath, join
from eossr.scripts import eossr_upload
......@@ -50,12 +51,12 @@ def test_help_all_scripts(script):
def test_eossr_upload(tmpdir):
file_handle, path_test_filename = tempfile.mkstemp(dir=tmpdir, text='Hello World')
assert os.path.exists(path_test_filename)
file_handle, path_test_filename = tempfile.mkstemp(dir=tmpdir, text=True)
Path(path_test_filename).write_text('Hello World')
published = eossr_upload.upload(os.getenv('SANDBOX_ZENODO_TOKEN'), True, tmpdir)
record_id = published.json()['id']
file_handle, path_test_filename = tempfile.mkstemp(dir=tmpdir, text='Hello World 2')
assert os.path.exists(path_test_filename)
file_handle, path_test_filename = tempfile.mkstemp(dir=tmpdir, text=True)
Path(path_test_filename).write_text('Hello World 2')
published = eossr_upload.upload(os.getenv('SANDBOX_ZENODO_TOKEN'), True, tmpdir, record_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment