diff options
author | drebs <drebs@leap.se> | 2013-01-03 17:23:42 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-01-03 17:23:42 -0200 |
commit | a1c727b32464895f2dc912672ec51d1e5b5f392d (patch) | |
tree | f9838cdd6c337f655c175e68c5cc0353c645435d | |
parent | 573b128dc2d9c20170385a6b819e3851420f1780 (diff) |
LeapDocument passes Document tests.
-rw-r--r-- | tests/test_leap_backend.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_leap_backend.py b/tests/test_leap_backend.py index 70cd8710..9a8daf1a 100644 --- a/tests/test_leap_backend.py +++ b/tests/test_leap_backend.py @@ -6,6 +6,7 @@ from u1db import ( ) from leap.soledad.backends import leap_backend as http_database +from leap.soledad.backends.leap_backend import LeapDocument from leap.soledad.tests import u1db_tests as tests from leap.soledad.tests.u1db_tests.test_http_database import ( @@ -14,6 +15,10 @@ from leap.soledad.tests.u1db_tests.test_http_database import ( TestHTTPDatabaseIntegration, ) from leap.soledad.tests.u1db_tests.test_http_client import TestHTTPClientBase +from leap.soledad.tests.u1db_tests.test_document import ( + TestDocument, + TestPyDocument, +) class TestLeapDatabaseSimpleOperations(TestHTTPDatabaseSimpleOperations): @@ -111,3 +116,20 @@ class TestLeapDatabaseIntegration(TestHTTPDatabaseIntegration): class TestLeapClientBase(TestHTTPClientBase): pass + + +def make_document_for_test(test, doc_id, rev, content, has_conflicts=False): + return LeapDocument(doc_id, rev, content, has_conflicts=has_conflicts) + + +class TestLeapDocument(TestDocument): + + scenarios = ([( + 'py', {'make_document_for_test': make_document_for_test})]) + + +class TestLeapPyDocument(TestPyDocument): + + scenarios = ([( + 'py', {'make_document_for_test': make_document_for_test})]) + |