Skip to content

Commit

Permalink
Add a test for the ERDDAP flag files
Browse files Browse the repository at this point in the history
  • Loading branch information
kwilcox committed Aug 14, 2017
1 parent bb0bb1c commit bb98a47
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gutils/tests/test_watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
ascii_path = output('ascii', 'usf-2016')
netcdf_path = output('netcdf', 'usf-2016')
erddap_content_path = output('erddap', 'content')
erddap_flag_path = output('erddap', 'flag')
ftp_path = output('ftp')

watch_dir = os.path.join(os.path.dirname(__file__), '..', 'watch')
Expand All @@ -46,6 +47,7 @@ def setUp(self):
safe_makedirs(netcdf_path)
safe_makedirs(ftp_path)
safe_makedirs(erddap_content_path)
safe_makedirs(erddap_flag_path)

def tearDown(self):
shutil.rmtree(output())
Expand Down Expand Up @@ -139,7 +141,8 @@ def test_gutils_netcdf_to_erddap_watch(self):
# Convert ASCII data to NetCDF
processor = Netcdf2ErddapProcessor(
outputs_path=os.path.dirname(netcdf_path),
erddap_content_path=erddap_content_path
erddap_content_path=erddap_content_path,
erddap_flag_path=erddap_flag_path
)
notifier = ThreadedNotifier(wm, processor, read_freq=5)
notifier.coalesce_events()
Expand All @@ -166,5 +169,8 @@ def test_gutils_netcdf_to_erddap_watch(self):
wm.rm_watch(wdd.values(), rec=True)
notifier.stop()

# Should outout 1 ERDDAP datasets.xml file
# Should output 1 ERDDAP datasets.xml file
assert len(os.listdir(erddap_content_path)) == 1

# Should try to flag the dataset
assert len(os.listdir(erddap_flag_path)) == 1

0 comments on commit bb98a47

Please sign in to comment.