database: add some tests for git transactions.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
parent
0d14ec597b
commit
a83ae0f348
1 changed files with 13 additions and 0 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
from newfol.database import DatabaseVersion, Database, Schema
|
||||
from newfol.filemanip import Record
|
||||
import os.path
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
class TestDatabaseVersion(unittest.TestCase):
|
||||
|
|
@ -41,5 +43,16 @@ class TestDatabaseAccessors(unittest.TestCase):
|
|||
self.assertEqual(obj.serialization(),
|
||||
DatabaseVersion.preferred().serialization())
|
||||
|
||||
class TestGitTransactions(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.ddir = tempfile.TemporaryDirectory()
|
||||
fp = open(self.ddir.name + "/schema", "w")
|
||||
fp.write("fmt:0:newfol schema file:\ntxn:git\n")
|
||||
fp.close()
|
||||
self.db = Database.load(self.ddir.name)
|
||||
def test_has_git_dir(self):
|
||||
self.db.store()
|
||||
self.assertTrue(os.path.isdir(self.ddir.name + "/.git"))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Reference in a new issue