def setup_method(self): """Setup things to be run when tests are started.""" self.hass = get_test_home_assistant() self.name = 'foo' self.resource = 'http://localhost/' self.body_on = Template('on', self.hass) self.body_off = Template('off', self.hass) self.switch = rest.RestSwitch(self.hass, self.name, self.resource, self.body_on, self.body_off, None, 10)
def setUp(self): """Setup things to be run when tests are started.""" self.hass = get_test_home_assistant() self.name = 'foo' self.resource = 'http://localhost/' self.body_on = 'on' self.body_off = 'off' self.switch = rest.RestSwitch(self.hass, self.name, self.resource, self.body_on, self.body_off)
def setup_method(self): """Set up things to be run when tests are started.""" self.hass = get_test_home_assistant() self.name = 'foo' self.method = 'post' self.resource = 'http://localhost/' self.headers = {'Content-type': 'application/json'} self.auth = None self.body_on = Template('on', self.hass) self.body_off = Template('off', self.hass) self.switch = rest.RestSwitch(self.name, self.resource, self.method, self.headers, self.auth, self.body_on, self.body_off, None, 10) self.switch.hass = self.hass