Creating a database that already exists in the glue data catalog raises an exception
This commit is contained in:
parent
e67a8c6f1b
commit
c5c57efbb5
3 changed files with 29 additions and 5 deletions
|
|
@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
|||
|
||||
from moto.core import BaseBackend, BaseModel
|
||||
from moto.compat import OrderedDict
|
||||
from.exceptions import DatabaseAlreadyExistsException
|
||||
|
||||
|
||||
class GlueBackend(BaseBackend):
|
||||
|
|
@ -10,6 +11,9 @@ class GlueBackend(BaseBackend):
|
|||
self.databases = OrderedDict()
|
||||
|
||||
def create_database(self, database_name):
|
||||
if database_name in self.databases:
|
||||
raise DatabaseAlreadyExistsException()
|
||||
|
||||
database = FakeDatabase(database_name)
|
||||
self.databases[database_name] = database
|
||||
return database
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue