Skip to content

Commit

Permalink
Update env
Browse files Browse the repository at this point in the history
  • Loading branch information
wpreimes committed Oct 8, 2024
1 parent 2be4a34 commit a43f457
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/smos_l2/test_l2_download.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import os
from tempfile import TemporaryDirectory
from smos.smos_l2.download import SmosDissEoFtp

def test_download_l2():
with TemporaryDirectory() as tempdir:
ftp = SmosDissEoFtp(local_root=tempdir, username='asd', password='asd',
skip_lftp_verify=True)
c = ftp.sync(2022, 1, 1, opts='-e --testflag 1 2 3', dry_run=True)
assert c == f'mirror -c -e --testflag 1 2 3 /SMOS/L2SM/MIR_SMUDP2_nc/2022/01/01 {tempdir}/2022/01/01 −−no−perms'
assert c == f'mirror -c -e --testflag 1 2 3 /SMOS/L2SM/MIR_SMUDP2_nc/2022/01/01 {os.path.join(tempdir, "2022", "01", "01")} −−no−perms'

def test_download_l2_period():
with TemporaryDirectory() as tempdir:
Expand All @@ -14,4 +16,4 @@ def test_download_l2_period():
cmds = ftp.sync_period('2022-01-01', '2022-01-03', dry_run=True)

for d in [1, 2, 3]:
assert cmds[d-1] == f'mirror -c /SMOS/L2SM/MIR_SMUDP2_nc/2022/01/0{d} {tempdir}/2022/01/0{d} −−no−perms'
assert cmds[d-1] == f'mirror -c /SMOS/L2SM/MIR_SMUDP2_nc/2022/01/0{d} {os.path.join(tempdir, "2022", "01", f"0{d}")} −−no−perms'

0 comments on commit a43f457

Please sign in to comment.