-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from wpreimes/develop
Add download test
- Loading branch information
Showing
6 changed files
with
45 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
''' | ||
Tests that use passed login information from travis CI to download a few files | ||
''' | ||
|
||
import os | ||
import tempfile | ||
|
||
from smap_io.download import main | ||
import unittest | ||
import time | ||
|
||
class DownloadTest(unittest.TestCase): | ||
|
||
# these tsts only run of a username and pw are in the environment variables | ||
# can be set manually with export USERNAME="my_username" etc. | ||
@unittest.skipIf("SMAPUSERNAME" not in os.environ or "SMAPPWD" not in os.environ, 'Username and/or PW not found') | ||
def test_full_download(self): | ||
|
||
dl_path = tempfile.mkdtemp() | ||
startdate = enddate = "2018-12-01" | ||
|
||
args = [dl_path, '-s', startdate, '-e', enddate, '--product', 'SPL3SMP.005', | ||
'--username', os.environ['SMAPUSERNAME'], '--password', os.environ['SMAPPWD']] | ||
|
||
main(args) | ||
assert(os.listdir(dl_path) == ['2018.12.01']) | ||
assert(os.listdir(os.path.join(dl_path, '2018.12.01')) == ['SMAP_L3_SM_P_20181201_R16020_002.h5']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters