File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 6
6
"base_url": "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_{metric}_US.csv",
7
7
"aws_credentials": {
8
8
"aws_access_key_id": "",
9
- "aws_secret_access_key": "",
10
- }
9
+ "aws_secret_access_key": ""
10
+ },
11
+ "bucket_name": ""
11
12
}
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
3
+ from boto3 import Session
4
+ from moto import mock_s3
3
5
import pytest
4
6
5
7
from os import listdir , remove
6
8
from os .path import join
7
9
10
+ from delphi_utils import read_params
8
11
from delphi_jhu .run import run_module
9
12
10
13
@@ -14,4 +17,11 @@ def run_as_module():
14
17
for fname in listdir ("receiving" ):
15
18
remove (join ("receiving" , fname ))
16
19
17
- run_module ()
20
+ with mock_s3 ():
21
+ # Create the fake bucket we will be using
22
+ params = read_params ()
23
+ aws_credentials = params ["aws_credentials" ]
24
+ s3_client = Session (** aws_credentials ).client ("s3" )
25
+ s3_client .create_bucket (Bucket = params ["bucket_name" ])
26
+
27
+ run_module ()
Original file line number Diff line number Diff line change 3
3
"static_file_dir": "../static",
4
4
"export_dir": "./receiving",
5
5
"cache_dir": "./cache",
6
- "base_url": "test_data/small_{metric}.csv"
6
+ "base_url": "test_data/small_{metric}.csv",
7
+ "aws_credentials": {
8
+ "aws_access_key_id": "FAKE_TEST_ACCESS_KEY_ID",
9
+ "aws_secret_access_key": "FAKE_TEST_SECRET_ACCESS_KEY"
10
+ },
11
+ "bucket_name": "test-bucket"
7
12
}
You can’t perform that action at this time.
0 commit comments