# Path: staticgen/helpers.py
# def get_static_site_domain():
#     static_site_domain = settings.STATICGEN_STATIC_SITE_DOMAIN
#     if static_site_domain is None:
#         connection = connect_s3(
#             settings.AWS_ACCESS_KEY_ID,
#             settings.AWS_SECRET_ACCESS_KEY
#         )
#         bucket = connection.get_bucket(settings.AWS_STORAGE_BUCKET_NAME)
#         static_site_domain = bucket.get_website_endpoint()
#     return static_site_domain.rstrip('/')


from django.conf import settings
from django.test import TestCase, override_settings
from boto import connect_s3
from moto import mock_s3
from staticgen.helpers import get_static_site_domain
# -*- coding: utf-8 -*-

from __future__ import unicode_literals




class TestStaticgenHelpers(TestCase):

    @mock_s3
    @override_settings(STATICGEN_STATIC_SITE_DOMAIN=None)
    def test_request_with_custom_header(self):
        # setUp
        connection = connect_s3()
        connection.create_bucket(settings.AWS_STORAGE_BUCKET_NAME)

# Path: staticgen/helpers.py
# def get_static_site_domain():
#     static_site_domain = settings.STATICGEN_STATIC_SITE_DOMAIN
#     if static_site_domain is None:
#         connection = connect_s3(
#             settings.AWS_ACCESS_KEY_ID,
#             settings.AWS_SECRET_ACCESS_KEY
#         )
#         bucket = connection.get_bucket(settings.AWS_STORAGE_BUCKET_NAME)
#         static_site_domain = bucket.get_website_endpoint()
#     return static_site_domain.rstrip('/')


# Path: tests/test_helpers.py
from django.conf import settings
from django.test import TestCase, override_settings
from boto import connect_s3
from moto import mock_s3
from staticgen.helpers import get_static_site_domain

# -*- coding: utf-8 -*-

from __future__ import unicode_literals




class TestStaticgenHelpers(TestCase):

    @mock_s3
    @override_settings(STATICGEN_STATIC_SITE_DOMAIN=None)
    def test_request_with_custom_header(self):
        # setUp
        connection = connect_s3()
        connection.create_bucket(settings.AWS_STORAGE_BUCKET_NAME)

        static_domain = get_static_site_domain()