# Path: tsuru_autoscale/alarm/forms.py
# class AlarmForm(forms.Form):
#     name = forms.CharField()
#     expression = forms.CharField()
#     enabled = forms.BooleanField(initial=True)
#     wait = forms.IntegerField()
#     datasource = forms.ChoiceField()
#     actions = forms.MultipleChoiceField()
#     instance = forms.ChoiceField()
# 
# Path: tsuru_autoscale/alarm/client.py
# def host():
# def new(data, token):
# def list(token):
# def remove(name, token):
# def get(name, token):
# def service_instance_list(token):


from django.test import TestCase
from django.core.urlresolvers import reverse
from tsuru_autoscale.alarm.forms import AlarmForm
from tsuru_autoscale.alarm import client
import httpretty
import mock
import os
    def test_remove(self):
        os.environ["AUTOSCALE_HOST"] = "http://autoscalehost.com"
        httpretty.register_uri(
            httpretty.DELETE,
            "http://autoscalehost.com/alarm/name",
        )

        client.remove("name", "token")

    def test_get(self):
        os.environ["AUTOSCALE_HOST"] = "http://autoscalehost.com"
        httpretty.register_uri(
            httpretty.GET,
            "http://autoscalehost.com/alarm/name",
            "result",
        )

        result = client.get("name", "token")
        self.assertEqual(result.text, "result")


class AlarmFormTestCase(TestCase):
    def test_required_fields(self):
        fields = {
            "name": True,
            "expression": True,
            "enabled": True,
            "wait": True,
        }


# Path: tsuru_autoscale/alarm/forms.py
# class AlarmForm(forms.Form):
#     name = forms.CharField()
#     expression = forms.CharField()
#     enabled = forms.BooleanField(initial=True)
#     wait = forms.IntegerField()
#     datasource = forms.ChoiceField()
#     actions = forms.MultipleChoiceField()
#     instance = forms.ChoiceField()
# 
# Path: tsuru_autoscale/alarm/client.py
# def host():
# def new(data, token):
# def list(token):
# def remove(name, token):
# def get(name, token):
# def service_instance_list(token):


# Path: tsuru_autoscale/alarm/tests.py
from django.test import TestCase
from django.core.urlresolvers import reverse
from tsuru_autoscale.alarm.forms import AlarmForm
from tsuru_autoscale.alarm import client
import httpretty
import mock
import os

    def test_remove(self):
        os.environ["AUTOSCALE_HOST"] = "http://autoscalehost.com"
        httpretty.register_uri(
            httpretty.DELETE,
            "http://autoscalehost.com/alarm/name",
        )

        client.remove("name", "token")

    def test_get(self):
        os.environ["AUTOSCALE_HOST"] = "http://autoscalehost.com"
        httpretty.register_uri(
            httpretty.GET,
            "http://autoscalehost.com/alarm/name",
            "result",
        )

        result = client.get("name", "token")
        self.assertEqual(result.text, "result")


class AlarmFormTestCase(TestCase):
    def test_required_fields(self):
        fields = {
            "name": True,
            "expression": True,
            "enabled": True,
            "wait": True,
        }


        form = AlarmForm()