Skip to content

Commit

Permalink
added tests for data_setup wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparrow0hawk committed Jan 28, 2021
1 parent 00c042e commit 0f9beb9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_utilities.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import unittest
from unittest.mock import patch, mock_open
from microsim.utilities import download_data, unpack_data
from microsim.utilities import download_data, unpack_data, data_setup

class TestDownloadData(unittest.TestCase):

Expand Down Expand Up @@ -35,6 +35,14 @@ def test_unpack_data(self, mock_tar):
mock_tar.open.assert_called_with("example_tar")
mock_tar.open().extractall.assert_called_with(".")

@patch("microsim.utilities.download_data")
@patch("microsim.utilities.unpack_data")
def test_data_setup(self, mock_ud, mock_dd):

data_setup(archive = 'devon_data')

mock_dd.assert_called_with(url="https://ramp0storage.blob.core.windows.net/rampdata/devon_data.tar.gz")
mock_ud.assert_called_with(archive = "devon_data")


if __name__ == '__main__':
Expand Down

0 comments on commit 0f9beb9

Please sign in to comment.