How to use the pysyncobj.createJournal function in pysyncobj

To help you get started, we’ve selected a few pysyncobj examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bakwc / PySyncObj / test_syncobj3.py View on Github external
def test_journalTest2():
	removeFiles(['journal.bin'])
	journal = createJournal('journal.bin')
	journal.add(b'cmd1', 1, 0)
	journal.add(b'cmd2', 2, 0)
	journal.add(b'cmd3', 3, 0)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 3
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd3', 3, 0)
	journal.deleteEntriesFrom(2)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 2
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd2', 2, 0)
github bakwc / PySyncObj / test_syncobj3.py View on Github external
journal = createJournal('journal.bin')
	assert len(journal) == 3
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd3', 3, 0)
	journal.deleteEntriesFrom(2)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 2
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd2', 2, 0)
	journal.deleteEntriesTo(1)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 1
	assert journal[0] == (b'cmd2', 2, 0)
	journal._destroy()
	removeFiles(['journal.bin'])
github bakwc / PySyncObj / test_syncobj.py View on Github external
removeFiles(journalFiles)
	journal = createJournal(journalFiles[0])
	journal.add(b'cmd1', 1, 0)
	journal.add(b'cmd2', 2, 0)
	journal.add(b'cmd3', 3, 0)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 3
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd3', 3, 0)
	journal.deleteEntriesFrom(2)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 2
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd2', 2, 0)
	journal.deleteEntriesTo(1)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 1
	assert journal[0] == (b'cmd2', 2, 0)
	journal._destroy()
	removeFiles(journalFiles)
github bakwc / PySyncObj / test_syncobj.py View on Github external
journal = createJournal(journalFiles[0])
	assert len(journal) == 3
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd3', 3, 0)
	journal.deleteEntriesFrom(2)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 2
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd2', 2, 0)
	journal.deleteEntriesTo(1)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 1
	assert journal[0] == (b'cmd2', 2, 0)
	journal._destroy()
	removeFiles(journalFiles)
github bakwc / PySyncObj / test_syncobj.py View on Github external
def test_journalTest2():

	journalFiles = [getNextJournalFile()]
	removeFiles(journalFiles)

	removeFiles(journalFiles)
	journal = createJournal(journalFiles[0])
	journal.add(b'cmd1', 1, 0)
	journal.add(b'cmd2', 2, 0)
	journal.add(b'cmd3', 3, 0)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 3
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd3', 3, 0)
	journal.deleteEntriesFrom(2)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 2
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd2', 2, 0)
github bakwc / PySyncObj / test_syncobj3.py View on Github external
def test_journalTest2():
	removeFiles(['journal.bin'])
	journal = createJournal('journal.bin')
	journal.add(b'cmd1', 1, 0)
	journal.add(b'cmd2', 2, 0)
	journal.add(b'cmd3', 3, 0)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 3
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd3', 3, 0)
	journal.deleteEntriesFrom(2)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 2
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd2', 2, 0)
	journal.deleteEntriesTo(1)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 1
	assert journal[0] == (b'cmd2', 2, 0)
github bakwc / PySyncObj / test_syncobj.py View on Github external
def test_journalTest2():

	journalFiles = [getNextJournalFile()]
	removeFiles(journalFiles)

	removeFiles(journalFiles)
	journal = createJournal(journalFiles[0])
	journal.add(b'cmd1', 1, 0)
	journal.add(b'cmd2', 2, 0)
	journal.add(b'cmd3', 3, 0)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 3
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd3', 3, 0)
	journal.deleteEntriesFrom(2)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 2
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd2', 2, 0)
	journal.deleteEntriesTo(1)
	journal._destroy()

	journal = createJournal(journalFiles[0])
	assert len(journal) == 1
	assert journal[0] == (b'cmd2', 2, 0)
github bakwc / PySyncObj / test_syncobj3.py View on Github external
def test_journalTest2():
	removeFiles(['journal.bin'])
	journal = createJournal('journal.bin')
	journal.add(b'cmd1', 1, 0)
	journal.add(b'cmd2', 2, 0)
	journal.add(b'cmd3', 3, 0)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 3
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd3', 3, 0)
	journal.deleteEntriesFrom(2)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 2
	assert journal[0] == (b'cmd1', 1, 0)
	assert journal[-1] == (b'cmd2', 2, 0)
	journal.deleteEntriesTo(1)
	journal._destroy()

	journal = createJournal('journal.bin')
	assert len(journal) == 1
	assert journal[0] == (b'cmd2', 2, 0)
	journal._destroy()
	removeFiles(['journal.bin'])