# Path: lighthouse/haproxy/stanzas/frontend.py
# class FrontendStanza(Stanza):
#     """
#     Stanza subclass representing a "frontend" stanza.
# 
#     A frontend stanza defines an address to bind to an a backend to route
#     traffic to.  A cluster can defined custom lines via a "frontend" entry
#     in their haproxy config dictionary.
#     """
# 
#     def __init__(self, cluster, bind_address=None):
#         super(FrontendStanza, self).__init__("frontend")
#         self.header = "frontend %s" % cluster.name
# 
#         if not bind_address:
#             bind_address = ""
# 
#         self.add_lines(cluster.haproxy.get("frontend", []))
#         self.add_line("bind %s:%s" % (bind_address, cluster.haproxy["port"]))
#         self.add_line("default_backend %s" % cluster.name)


    import unittest2 as unittest
    import unittest
from mock import Mock
from lighthouse.haproxy.stanzas.frontend import FrontendStanza
try:
except ImportError:




class FrontendStanzaTests(unittest.TestCase):

    def test_default_bind_address_is_blank(self):
        cluster = Mock()
        cluster.name = "datastore"
        cluster.haproxy = {
            "port": 99
        }


# Path: lighthouse/haproxy/stanzas/frontend.py
# class FrontendStanza(Stanza):
#     """
#     Stanza subclass representing a "frontend" stanza.
# 
#     A frontend stanza defines an address to bind to an a backend to route
#     traffic to.  A cluster can defined custom lines via a "frontend" entry
#     in their haproxy config dictionary.
#     """
# 
#     def __init__(self, cluster, bind_address=None):
#         super(FrontendStanza, self).__init__("frontend")
#         self.header = "frontend %s" % cluster.name
# 
#         if not bind_address:
#             bind_address = ""
# 
#         self.add_lines(cluster.haproxy.get("frontend", []))
#         self.add_line("bind %s:%s" % (bind_address, cluster.haproxy["port"]))
#         self.add_line("default_backend %s" % cluster.name)


# Path: tests/haproxy/stanzas/frontend_tests.py
    import unittest2 as unittest
    import unittest
from mock import Mock
from lighthouse.haproxy.stanzas.frontend import FrontendStanza

try:
except ImportError:




class FrontendStanzaTests(unittest.TestCase):

    def test_default_bind_address_is_blank(self):
        cluster = Mock()
        cluster.name = "datastore"
        cluster.haproxy = {
            "port": 99
        }


        stanza = FrontendStanza(cluster)