Esempio n. 1
0
def process_data(s3bucket, rdsconn, row):
  try:
    # get file info
    datatype = row[1]
    datadate = str(row[2]).replace('-', '')
    filename = row[4].split('/')[-1]
    log.print_log(logger, 'file:{0} type:{1} date:{2}'.format(filename, datatype, datadate))
    # download file to local
    aws.get_contents(s3bucket, filename, TMP_DIR)
  except Exception as e:
    log.except_log(logger, e)
Esempio n. 2
0
 def test_get_contents_e(self):
   conn = aws.s3conn()
   bucket = conn.get_bucket(self.bucket_name)
   filepath = os.path.join(os.path.dirname('__file__'))
   aws.get_contents(bucket,'somemissingfile',filepath)
Esempio n. 3
0
 def test_get_contents(self):
   conn = aws.s3conn()
   bucket = conn.get_bucket(self.bucket_name)
   filepath = os.path.join(os.path.dirname('__file__'))
   actual = aws.get_contents(bucket,'dl_testfile',filepath)
   assert actual is True