Beispiel #1
0
 def setUp(self):  # noqa
     DataServiceRegressionTests.setUp(self)
     self.container = self.ds['RegressionModel.RegressionContainer']
     self.d = FilePath.mkdtemp('.d', 'pyslet-test_odata2_sqlds-')
     self.db = sqlds.SQLiteEntityContainer(
         file_path=self.d.join('test.db'),
         container=self.container,
         streamstore=sqlds.SQLiteStreamStore(
             file_path=self.d.join('streamstore.db')))
     self.db.create_all_tables()
Beispiel #2
0
 def setUp(self):        # noqa
     # load a suitable database schema
     metadata = lti.load_metadata()
     self.container = metadata.root.DataServices.defaultContainer
     self.data_source = sql.SQLiteEntityContainer(
         file_path=':memory:', container=self.container)
     self.data_source.create_all_tables()
     self.cipher = wsgi.AppCipher(0, 'secret', self.container['AppKeys'])
     with self.container['Silos'].open() as collection:
         self.silo = collection.new_entity()
         self.silo['ID'].set_from_value(wsgi.key60(b'testing'))
         self.silo['Slug'].set_from_value('testing')
         collection.insert_entity(self.silo)
Beispiel #3
0
 def setUp(self):  # noqa
     self.cwd = FilePath.getcwd()
     TEST_DATA_DIR.chdir()
     self.doc = edmx.Document()
     md_path = TEST_DATA_DIR.join('sample_server', 'metadata.xml')
     with md_path.open('rb') as f:
         self.doc.read(f)
     self.schema = self.doc.root.DataServices['SampleModel']
     self.container = self.doc.root.DataServices[
         "SampleModel.SampleEntities"]
     self.d = FilePath.mkdtemp('.d', 'pyslet-test_odata2_sqlds-')
     self.db = sqlds.SQLiteEntityContainer(file_path=self.d.join('test.db'),
                                           container=self.container)
Beispiel #4
0
 def setUp(self):  # noqa
     # load a suitable database schema
     metadata = lti.load_metadata()
     self.container = metadata.root.DataServices.defaultContainer
     self.data_source = sql.SQLiteEntityContainer(file_path=':memory:',
                                                  container=self.container)
     self.data_source.create_all_tables()
     self.cipher = wsgi.AppCipher(0, 'secret', self.container['AppKeys'])
     with self.container['Silos'].OpenCollection() as collection:
         self.silo = collection.new_entity()
         self.silo['ID'].set_from_value(wsgi.key60('testing'))
         self.silo['Slug'].set_from_value('testing')
         collection.insert_entity(self.silo)
     self.save_time = time.time
     self.mock_time = MockTime(1420370306 + MockTime.oauth_origin)
     # patch the time module to mock it
     time.time = self.mock_time.time
Beispiel #5
0
 def setUp(self):        # noqa
     metadata = lti.load_metadata()
     self.container = metadata.root.DataServices.defaultContainer
     self.data_source = sql.SQLiteEntityContainer(
         file_path=':memory:', container=self.container)
     self.data_source.create_all_tables()
     self.cipher = wsgi.AppCipher(0, 'secret', self.container['AppKeys'])
     with self.container['Silos'].open() as collection:
         self.silo = collection.new_entity()
         self.silo['ID'].set_from_value(wsgi.key60(b'ToolProviderSession'))
         self.silo['Slug'].set_from_value('ToolProviderSession')
         collection.insert_entity(self.silo)
     # create a consumer
     with self.silo['Consumers'].open() as collection:
         self.consumer = lti.ToolConsumer.new_from_values(
             collection.new_entity(), self.cipher, 'test', '12345',
             'secret')
         collection.insert_entity(self.consumer.entity)