add try catch for missing package in old boto versions
This commit is contained in:
parent
637fef1302
commit
6277f72c07
3 changed files with 23 additions and 15 deletions
|
|
@ -3,12 +3,15 @@ import sure # noqa
|
|||
from freezegun import freeze_time
|
||||
from boto.exception import JSONResponseError
|
||||
from moto import mock_dynamodb2
|
||||
from boto.dynamodb2.fields import HashKey
|
||||
from boto.dynamodb2.fields import RangeKey
|
||||
from boto.dynamodb2.table import Table
|
||||
from boto.dynamodb2.table import Item
|
||||
from tests.helpers import requires_boto_gte
|
||||
|
||||
try:
|
||||
from boto.dynamodb2.fields import HashKey
|
||||
from boto.dynamodb2.fields import RangeKey
|
||||
from boto.dynamodb2.table import Table
|
||||
from boto.dynamodb2.table import Item
|
||||
except ImportError:
|
||||
print "This boto version is not supported"
|
||||
|
||||
def create_table():
|
||||
table = Table.create('messages', schema=[
|
||||
HashKey('forum_name')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue