Beispiel #1
0
 def test_ensure_user_and_db_exist_creates_user_and_db_when_they_dont_exist(self):
     try:
         database.ensure_user_and_db_exist(
             user=self.TEST_USER, password=self.TEST_PASSWORD,
             db_name=self.TEST_DB)
         self.assert_user_has_access_to_database()
     finally:
         self.drop_database_user()
         self.drop_database()
Beispiel #2
0
 def test_ensure_user_and_db_exist_creates_user_and_db_when_they_dont_exist(self):
     try:
         database.ensure_user_and_db_exist(
             user=self.TEST_USER, password=self.TEST_PASSWORD,
             db_name=self.TEST_DB)
         self.assert_user_has_access_to_database()
     finally:
         self.drop_database_user()
         self.drop_database()
Beispiel #3
0
 def test_ensure_user_and_db_exist_doesnt_cause_error_when_user_and_db_exist(self):
     self.create_database_user()
     self.create_database()
     self.grant_privileges()
     try:
         database.ensure_user_and_db_exist(
             user=self.TEST_USER, password=self.TEST_PASSWORD,
             db_name=self.TEST_DB)
     except Exception as e:
         self.fail('ensure_user_and_db_exist() raised exception: %s' % e)
     finally:
         self.drop_database_user()
         self.drop_database()
Beispiel #4
0
 def test_ensure_user_and_db_exist_doesnt_cause_error_when_user_and_db_exist(self):
     self.create_database_user()
     self.create_database()
     self.grant_privileges()
     try:
         database.ensure_user_and_db_exist(
             user=self.TEST_USER, password=self.TEST_PASSWORD,
             db_name=self.TEST_DB)
     except Exception as e:
         self.fail('ensure_user_and_db_exist() raised exception: %s' % e)
     finally:
         self.drop_database_user()
         self.drop_database()