def test_set_hipchat_mode(self): '''Can set the hipchat mode for an environment ''' for mode in ('off', 'quiet', 'all'): environment.set_hipchat_mode(self.environment_id, mode) actual = environment.get_by_id(self.environment_id) eq_(actual['hipchat_mode'], mode)
def setup_class(cls): '''load data & set up expected results ''' with gus.config.get_db_conn().cursor() as c: c.execute("TRUNCATE TABLE environments CASCADE") cls.expected_id_list = [] cls.expected_id_list.append(environment.create('production')) cls.expected_id_list.append(environment.create('dev')) cls.expected_id_list.append(environment.create('testing')) cls.expected_object_list = [environment.get_by_id(eid) for eid in cls.expected_id_list]
def test_get_by_id(self): '''Can look up an environment by it's id ''' actual = environment.get_by_id(self.environment_id) eq_(actual['environment_name'], self.environment_name)