import unittest

from programy.config.file.yaml_file import YamlConfigurationFile
from programy.clients.restful.flask.twilio.config import TwilioConfiguration
from programy.clients.events.console.config import ConsoleConfiguration

class TwilioConfigurationTests(unittest.TestCase):

    def test_init(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        twilio:
          host: 127.0.0.1
          port: 5000
          debug: false
        """, ConsoleConfiguration(), ".")

        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, ".")

        self.assertEqual("127.0.0.1", twilio_config.host)
        self.assertEqual(5000, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)

    def test_init_no_values(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        twilio:
        """, ConsoleConfiguration(), ".")

        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, ".")

        self.assertEqual("0.0.0.0", twilio_config.host)
        self.assertEqual(80, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)

8bf682f37e74f81251e5423bc1c41be356aab2fb
<mask token>


class TwilioConfigurationTests(unittest.TestCase):
    <mask token>
    <mask token>

<mask token>


class TwilioConfigurationTests(unittest.TestCase):
    <mask token>

    def test_init_no_values(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        twilio:
        """,
            ConsoleConfiguration(), '.')
        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, '.')
        self.assertEqual('0.0.0.0', twilio_config.host)
        self.assertEqual(80, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)

<mask token>


class TwilioConfigurationTests(unittest.TestCase):

    def test_init(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text(
            """
        twilio:
          host: 127.0.0.1
          port: 5000
          debug: false
        """
            , ConsoleConfiguration(), '.')
        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, '.')
        self.assertEqual('127.0.0.1', twilio_config.host)
        self.assertEqual(5000, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)

    def test_init_no_values(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        twilio:
        """,
            ConsoleConfiguration(), '.')
        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, '.')
        self.assertEqual('0.0.0.0', twilio_config.host)
        self.assertEqual(80, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)

import unittest
from programy.config.file.yaml_file import YamlConfigurationFile
from programy.clients.restful.flask.twilio.config import TwilioConfiguration
from programy.clients.events.console.config import ConsoleConfiguration


class TwilioConfigurationTests(unittest.TestCase):

    def test_init(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text(
            """
        twilio:
          host: 127.0.0.1
          port: 5000
          debug: false
        """
            , ConsoleConfiguration(), '.')
        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, '.')
        self.assertEqual('127.0.0.1', twilio_config.host)
        self.assertEqual(5000, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)

    def test_init_no_values(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        twilio:
        """,
            ConsoleConfiguration(), '.')
        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, '.')
        self.assertEqual('0.0.0.0', twilio_config.host)
        self.assertEqual(80, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)

import unittest

from programy.config.file.yaml_file import YamlConfigurationFile
from programy.clients.restful.flask.twilio.config import TwilioConfiguration
from programy.clients.events.console.config import ConsoleConfiguration

class TwilioConfigurationTests(unittest.TestCase):

    def test_init(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        twilio:
          host: 127.0.0.1
          port: 5000
          debug: false
        """, ConsoleConfiguration(), ".")

        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, ".")

        self.assertEqual("127.0.0.1", twilio_config.host)
        self.assertEqual(5000, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)

    def test_init_no_values(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        twilio:
        """, ConsoleConfiguration(), ".")

        twilio_config = TwilioConfiguration()
        twilio_config.load_configuration(yaml, ".")

        self.assertEqual("0.0.0.0", twilio_config.host)
        self.assertEqual(80, twilio_config.port)
        self.assertEqual(False, twilio_config.debug)
