reformatting

This commit is contained in:
Blake Eggleston
2014-03-11 13:08:53 -07:00
parent 6b0a4dc3bd
commit 1c6660199b

View File

@@ -3,7 +3,6 @@ Tests surrounding the blah.timestamp( timedelta(seconds=30) ) format.
"""
from datetime import timedelta, datetime
import unittest
from uuid import uuid4
import mock
import sure
@@ -19,12 +18,15 @@ class TestTimestampModel(Model):
class BaseTimestampTest(BaseCassEngTestCase):
@classmethod
def setUpClass(cls):
super(BaseTimestampTest, cls).setUpClass()
sync_table(TestTimestampModel)
class BatchTest(BaseTimestampTest):
def test_batch_is_included(self):
with mock.patch.object(ConnectionPool, "execute") as m, BatchQuery(timestamp=timedelta(seconds=30)) as b:
TestTimestampModel.batch(b).create(count=1)
@@ -32,7 +34,6 @@ class BatchTest(BaseTimestampTest):
"USING TIMESTAMP".should.be.within(m.call_args[0][0])
class CreateWithTimestampTest(BaseTimestampTest):
def test_batch(self):
@@ -44,8 +45,6 @@ class CreateWithTimestampTest(BaseTimestampTest):
query.should.match(r"INSERT.*USING TIMESTAMP")
query.should_not.match(r"TIMESTAMP.*INSERT")
def test_timestamp_not_included_on_normal_create(self):
with mock.patch.object(ConnectionPool, "execute") as m:
TestTimestampModel.create(count=2)
@@ -90,7 +89,9 @@ class UpdateWithTimestampTest(BaseTimestampTest):
query = m.call_args[0][0]
"USING TIMESTAMP".should.be.within(query)
class DeleteWithTimestampTest(BaseTimestampTest):
def test_non_batch(self):
"""
we don't expect the model to come back at the end because the deletion timestamp should be in the future
@@ -122,10 +123,6 @@ class DeleteWithTimestampTest(BaseTimestampTest):
tmp.update()
tmp._timestamp.shouldnt.be.ok
def test_blind_delete(self):
"""
we don't expect the model to come back at the end because the deletion timestamp should be in the future
@@ -178,6 +175,3 @@ class DeleteWithTimestampTest(BaseTimestampTest):
TestTimestampModel.get(id=uid)