def test_success_publish_pricing_data(self):
     """test_success_publish_pricing_data"""
     work = build_publish_pricing_request()
     res = run_publish_pricing_update(
         work)
     self.assertTrue(
         res['status'] == SUCCESS)
     self.assertTrue(
         res['err'] is None)
     self.assertTrue(
         res['rec'] is not None)
     record = res['rec']
     self.assertEqual(
         record['ticker'],
         TICKER)
     self.assertEqual(
         record['s3_enabled'],
         False)
     self.assertEqual(
         record['redis_enabled'],
         False)
     self.assertEqual(
         record['s3_bucket'],
         work['s3_bucket'])
     self.assertEqual(
         record['s3_key'],
         work['s3_key'])
     self.assertEqual(
         record['redis_key'],
         work['redis_key'])
 def test_err_publish_pricing_data(self):
     """test_err_publish_pricing_data"""
     work = build_publish_pricing_request()
     work['ticker'] = None
     res = run_publish_pricing_update(
         work)
     self.assertTrue(
         res['status'] == ERR)
     self.assertTrue(
         res['err'] == 'missing ticker')
 def test_success_redis_set(self):
     """test_success_redis_set"""
     work = build_publish_pricing_request()
     work['s3_enabled'] = 0
     work['redis_enabled'] = 1
     work['redis_address'] = REDIS_ADDRESS
     work['redis_db'] = REDIS_DB
     work['redis_key'] = REDIS_KEY
     work['redis_password'] = REDIS_PASSWORD
     work['redis_expire'] = REDIS_EXPIRE
     res = run_publish_pricing_update(
         work)
     self.assertTrue(
         res['status'] == SUCCESS)
 def test_success_s3_upload(self):
     """test_success_s3_upload"""
     work = build_publish_pricing_request()
     work['s3_enabled'] = 1
     work['redis_enabled'] = 0
     work['s3_access_key'] = S3_ACCESS_KEY
     work['s3_secret_key'] = S3_SECRET_KEY
     work['s3_region_name'] = S3_REGION_NAME
     work['s3_address'] = S3_ADDRESS
     work['s3_secure'] = S3_SECURE
     res = run_publish_pricing_update(
         work)
     self.assertTrue(
         res['status'] == SUCCESS)
 def test_integration_redis_set(self):
     """test_integration_redis_set"""
     if ev('INT_TESTS', '0') == '1':
         work = build_publish_pricing_request()
         work['s3_enabled'] = 0
         work['redis_enabled'] = 1
         work['redis_address'] = REDIS_ADDRESS
         work['redis_db'] = REDIS_DB
         work['redis_key'] = REDIS_KEY
         work['redis_password'] = REDIS_PASSWORD
         work['redis_expire'] = REDIS_EXPIRE
         work['redis_key'] = 'integration-test-v1'
         work['s3_key'] = 'integration-test-v1'
         res = run_publish_pricing_update(
             work)
         self.assertTrue(
             res['status'] == SUCCESS)
 def test_integration_s3_upload(self):
     """test_integration_s3_upload"""
     if ev('INT_TESTS', '0') == '1':
         work = build_publish_pricing_request()
         work['s3_enabled'] = 1
         work['redis_enabled'] = 0
         work['s3_access_key'] = S3_ACCESS_KEY
         work['s3_secret_key'] = S3_SECRET_KEY
         work['s3_region_name'] = S3_REGION_NAME
         work['s3_address'] = S3_ADDRESS
         work['s3_secure'] = S3_SECURE
         work['s3_bucket'] = 'integration-tests'
         work['s3_key'] = 'integration-test-v1'
         work['redis_key'] = 'integration-test-v1'
         os.environ.pop('AWS_DEFAULT_PROFILE', None)
         res = run_publish_pricing_update(
             work)
         self.assertTrue(
             res['status'] == SUCCESS)