mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
Add test for callback events flush with nothing in the buffer
This commit is contained in:
parent
6c1d4a5cfd
commit
51112b95bc
@ -116,6 +116,13 @@ class TestCallbackBrokerWorker(TransactionTestCase):
|
||||
assert worker.buff.get(InventoryUpdateEvent, []) == []
|
||||
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):
|
||||
# In postgres, text fields reject NUL character, 0x00
|
||||
# tests use sqlite3 which will not raise an error
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user