Exemplo n.º 1
0
 def test_mget_all(self):
   '''Can get a list of all environments
   '''
   environment.create('stage')
   environment.create('prod')
   actual = environment.mget_all(offset=0, limit=10)
   eq_([env['environment_name'] for env in actual],
       [self.environment_name, 'stage', 'prod'])
Exemplo n.º 2
0
 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]
Exemplo n.º 3
0
 def setup(self):
   '''Clear out the database & create a test project
   '''
   # TODO: refactor database cleanup
   self.db_conn = gus.config.get_db_conn()
   with self.db_conn.cursor() as c:
     c.execute("TRUNCATE TABLE environments CASCADE")
   self.environment_name = 'dev'
   self.environment_id = environment.create(self.environment_name)