1 import wsgi_intercept.httplib2_intercept
2 wsgi_intercept.httplib2_intercept.install()
3
4 from grassyknoll.lib import Norman
5
6 from grassyknoll.tests.test_GenericCollection import makeTests
7 from grassyknoll.backend.dictionary.DictCollection import DictCollection
8 from grassyknoll.backend.litesql.SqliteCollection import SqliteCollection, TableMaker
9 from grassyknoll.backend.lucene.LuceneCollection import LuceneCollection, LuceneNorman, SmartFieldNorman
10 from grassyknoll.frontend.RestCollection import CollectionApplication
11 from grassyknoll.client.ClientCollection import ClientCollection
12
13
14 norman = LuceneNorman()
15 norman.size = SmartFieldNorman(store=True)
16 norman.color = SmartFieldNorman(store=True)
17
18 table = TableMaker.Table('main')
19 table.size = TableMaker.Column(int)
20 table.color = TableMaker.Column(str)
21
22
23 makeTests(DictCollection)
24 makeTests(SqliteCollection.factory(filename='data', table=table, create=True),
25 __name__ + '.SqliteCollection')
26 makeTests(LuceneCollection.factory(index_dir='data', default_storage_norman=norman, create=True),
27 __name__ + '.LuceneCollection')
28
29
30
31
32
33
34 client_underlying_collection=None
35 create_app=lambda: CollectionApplication(client_underlying_collection, Norman.IdemNorman())
36 wsgi_intercept.add_wsgi_intercept('localhost', 8080, create_app)
37
38 makeTests(ClientCollection.factory(base_uri="http://localhost:8080/"),
39 __name__ + '.ClientCollection')
40
44
45 TestClientCollection.setup_hook=client_setup_hook
46 TestCreateClientCollection.setup_hook=client_setup_hook
47 TestEmptyClientCollection.setup_hook=client_setup_hook
48