Commit graph

20 commits

Author SHA1 Message Date
brian m. carlson
f85219647d
Add tests for the Singleton metaclass.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-22 02:27:21 +00:00
brian m. carlson
94a0b685d4
Implement support for autodetecting hashes.
The appropriate hash to use for validating the data is automatically
detected, and if no hash type is specified, use SHA-512 on 64-bit systems
and SHA-256 on 32-bit systems, as this provides the best performance.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-11 18:37:40 +00:00
brian m. carlson
082fd07c62
Generate testcases on the fly.
Use hashlib to generate the testcases instead of relying on hard-coded
values.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-11 18:15:00 +00:00
brian m. carlson
2a8c8d2d2a
Support SHA-384 and SHA-512.
Turn the SHA256Transaction store into a HashTransactionStore and support
SHA-384 and SHA-512, which provide better performance on 64-bit systems.
Don't support SHA-224 since it is weaker and is only useful where the hash
would be truncated anyway.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-11 00:58:54 +00:00
brian m. carlson
b3b76c7a57
Add helpful comments to unit test.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-09 02:08:04 +00:00
brian m. carlson
09d0d11751
Add more SHA-256 tests.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-09 01:57:46 +00:00
brian m. carlson
450bf7ff6a
Properly report open mode to transaction stores.
The mode was always being reported as "w" (write), which resulted in SHA-256
checksums not being validated on load.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-08 03:34:54 +00:00
brian m. carlson
3d39ca84e6
Silence ResourceWarning in tests.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-08 03:28:01 +00:00
brian m. carlson
41fef74e9d
Add more tests for SHA256TransactionStore.
One of the tests is a known failure because of a bug, so mark it accordingly.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-08 03:27:20 +00:00
brian m. carlson
e509dacc9a
Add a basic test for the SHA-256 Transaction store.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-05 19:29:21 +00:00
brian m. carlson
544fc064e9
filemanip: use reasonable committer ID for git.
We should not rely on the user setting up reasonable values for the committer
identification for git.  Use a committer name of newfol and an email address
consisting of the user's username and the FQDN of the machine.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-01 20:30:03 +00:00
brian m. carlson
a83ae0f348
database: add some tests for git transactions.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-01 20:02:21 +00:00
brian m. carlson
0d14ec597b
filemanip: add tests for YAML.
Since currently we can only serialize YAML, not load it, verify that it
serializes correctly twice.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-12-31 23:41:28 +00:00
brian m. carlson
cb17765453
Check that serialized data is stable.
Extend the filemanip tests to ensure that the data is serialized the same way
every time.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-12-31 23:38:25 +00:00
brian m. carlson
e560f273b0
Fix JSON round-tripping.
This also includes a unit test to ensure that round-tripping works properly for
those serializations where it's supported.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-11-16 23:08:13 +00:00
brian m. carlson
0263792fde
Update database test for new record version.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-11-16 02:17:59 +00:00
brian m. carlson
629aba310b
Add a test to ensure git transactions work.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-11-16 02:16:19 +00:00
brian m. carlson
083f411d34
Add basic Database and Schema objects.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-10-12 19:53:45 +00:00
brian m. carlson
0ad382de85
Move DatabaseVersion to newfol.database.
Also add unit tests for it.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-10-12 19:30:31 +00:00
brian m. carlson
ae4de78165
Compute the version automatically from git.
Also included are unit tests to verify the behavior of the new version
computation functions.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-10-12 19:17:32 +00:00