75
75
self.backend.create_message('a', 'q', 'm', 'test')
76
76
filters = dict(detail='bad')
77
77
accounts = self.backend.delete_accounts(filters)
78
self.assertRaises(burrow.backend.BadDetail, list, accounts)
78
self.assertRaises(burrow.backend.InvalidArguments, list, accounts)
79
79
self.assertEquals([], list(self.backend.delete_accounts()))
81
81
def test_accounts_delete_marker(self):
145
145
self.backend.create_message('a', 'q', 'm', 'test')
146
146
filters = dict(detail='bad')
147
147
accounts = self.backend.get_accounts(filters)
148
self.assertRaises(burrow.backend.BadDetail, list, accounts)
148
self.assertRaises(burrow.backend.InvalidArguments, list, accounts)
149
149
self.assertEquals([], list(self.backend.delete_accounts()))
151
151
def test_accounts_get_marker(self):
237
237
self.backend.create_message('a', 'q', 'm', 'test')
238
238
filters = dict(detail='bad')
239
239
queues = self.backend.delete_queues('a', filters)
240
self.assertRaises(burrow.backend.BadDetail, list, queues)
240
self.assertRaises(burrow.backend.InvalidArguments, list, queues)
241
241
self.assertEquals([], list(self.backend.delete_queues('a')))
243
243
def test_queues_delete_marker(self):
307
307
self.backend.create_message('a', 'q', 'm', 'test')
308
308
filters = dict(detail='bad')
309
309
queues = self.backend.get_queues('a', filters)
310
self.assertRaises(burrow.backend.BadDetail, list, queues)
310
self.assertRaises(burrow.backend.InvalidArguments, list, queues)
311
311
self.assertEquals([], list(self.backend.delete_queues('a')))
313
313
def test_queues_get_marker(self):
428
428
self.backend.create_message('a', 'q', 'm', 'test')
429
429
filters = dict(detail='bad')
430
430
messages = self.backend.delete_messages('a', 'q', filters)
431
self.assertRaises(burrow.backend.BadDetail, list, messages)
431
self.assertRaises(burrow.backend.InvalidArguments, list, messages)
432
432
self.assertEquals([], list(self.backend.delete_messages('a', 'q')))
434
434
def test_messages_delete_marker(self):
514
514
self.backend.create_message('a', 'q', 'm', 'test')
515
515
filters = dict(detail='bad')
516
516
messages = self.backend.get_messages('a', 'q', filters)
517
self.assertRaises(burrow.backend.BadDetail, list, messages)
517
self.assertRaises(burrow.backend.InvalidArguments, list, messages)
518
518
self.delete_messages()
520
520
def test_messages_get_marker(self):
618
618
attributes = dict(ttl=100, hide=200)
619
619
filters = dict(detail='bad')
620
620
messages = self.backend.update_messages('a', 'q', attributes, filters)
621
self.assertRaises(burrow.backend.BadDetail, list, messages)
621
self.assertRaises(burrow.backend.InvalidArguments, list, messages)
622
622
self.delete_messages()
624
624
def test_messages_update_marker(self):
752
752
def test_message_delete_detail_bad(self):
753
753
self.backend.create_message('a', 'q', 'm', 'test')
754
754
filters = dict(detail='bad')
755
self.assertRaises(burrow.backend.BadDetail,
755
self.assertRaises(burrow.backend.InvalidArguments,
756
756
self.backend.delete_message, 'a', 'q', 'm', filters)
757
757
self.delete_messages()
794
794
def test_message_get_detail_bad(self):
795
795
self.backend.create_message('a', 'q', 'm', 'test')
796
796
filters = dict(detail='bad')
797
self.assertRaises(burrow.backend.BadDetail,
797
self.assertRaises(burrow.backend.InvalidArguments,
798
798
self.backend.get_message, 'a', 'q', 'm', filters)
799
799
self.delete_messages()
848
848
self.backend.create_message('a', 'q', 'm', 'test')
849
849
attributes = dict(ttl=100, hide=200)
850
850
filters = dict(detail='bad')
851
self.assertRaises(burrow.backend.BadDetail,
851
self.assertRaises(burrow.backend.InvalidArguments,
852
852
self.backend.update_message, 'a', 'q', 'm', attributes, filters)
853
853
self.delete_messages()
855
855
def test_message_ttl(self):
856
856
attributes = dict(ttl=1)
857
857
self.backend.create_message('a', 'q', 'm', 'test', attributes)
859
859
self.backend.clean()
861
861
def test_message_ttl_large(self):
862
862
attributes = dict(ttl=1)
863
863
for x in xrange(0, 1000):
864
864
self.backend.create_message('a', 'q', str(x), str(x), attributes)
866
866
self.backend.clean()
868
868
def test_message_hide(self):
869
869
attributes = dict(hide=1)
870
870
self.backend.create_message('a', 'q', 'm', 'test', attributes)
872
872
self.backend.clean()
873
873
message = self.backend.get_message('a', 'q', 'm')
874
874
self.assertEquals(dict(id='m', ttl=0, hide=0, body='test'), message)
878
878
attributes = dict(hide=1)
879
879
for x in xrange(0, 1000):
880
880
self.backend.create_message('a', 'q', str(x), str(x), attributes)
882
882
self.backend.clean()
883
883
message = self.backend.get_message('a', 'q', '0')
884
884
self.assertEquals(dict(id='0', ttl=0, hide=0, body='0'), message)