Exemple #1
0
 def setup_class(cls):
   """Load test data
   """
   with gus.config.get_db_conn().cursor() as c:
     c.execute("TRUNCATE TABLE chef_roles, chef_roles_xref_projects CASCADE")
   cls.expected_id_list = []
   cls.expected_id_list.append(chef_role.create('www'))
   cls.expected_id_list.append(chef_role.create('admin'))
   cls.expected_id_list.append(chef_role.create('postgres'))
   cls.expected_id_list.append(chef_role.create('helios'))
   cls.expected_id_list.reverse()
   cls.expected_object_list = [chef_role.get_by_id(r_id)
       for r_id in cls.expected_id_list]
Exemple #2
0
 def test_get_by_id(self):
   """Can look up a configured chef role by its id
   """
   actual = chef_role.get_by_id(self.role_id)
   eq_(actual['chef_role_name'], self.role_name)