mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Add test for callback events flush with nothing in the buffer
This commit is contained in:
@@ -116,6 +116,13 @@ class TestCallbackBrokerWorker(TransactionTestCase):
|
|||||||
assert worker.buff.get(InventoryUpdateEvent, []) == []
|
assert worker.buff.get(InventoryUpdateEvent, []) == []
|
||||||
assert InventoryUpdateEvent.objects.filter(uuid=events[0].uuid).count() == 0 # sanity
|
assert InventoryUpdateEvent.objects.filter(uuid=events[0].uuid).count() == 0 # sanity
|
||||||
|
|
||||||
|
def test_flush_with_empty_buffer(self):
|
||||||
|
worker = self.get_worker()
|
||||||
|
worker.buff = {InventoryUpdateEvent: []}
|
||||||
|
with mock.patch.object(InventoryUpdateEvent.objects, 'bulk_create') as flush_mock:
|
||||||
|
worker.flush()
|
||||||
|
flush_mock.assert_not_called()
|
||||||
|
|
||||||
def test_postgres_invalid_NUL_char(self):
|
def test_postgres_invalid_NUL_char(self):
|
||||||
# In postgres, text fields reject NUL character, 0x00
|
# In postgres, text fields reject NUL character, 0x00
|
||||||
# tests use sqlite3 which will not raise an error
|
# tests use sqlite3 which will not raise an error
|
||||||
|
|||||||
Reference in New Issue
Block a user