Ejemplo n.º 1
0
    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_all_stubs()
        self.cookies = {}

        self.tree = dt.DatastoreTree()
Ejemplo n.º 2
0
 def setUp(self):
     test_util.InitAppHostingApi()
     self._tree = datastore_tree.DatastoreTree()
     self._tree.Clear()
     self._tree.SetFile('/foo', '123')
     self._tree.SetFile('/bar', '456')
     self.time_created = datetime.datetime.utcnow()
Ejemplo n.º 3
0
 def SetUpApplication(self, tree=None):
     """Sets up the control application and its tree."""
     if tree:
         self._tree = tree
     else:
         self._tree = datastore_tree.DatastoreTree()
     self._application = control.MakeControlApp(
         self._tree, 'test_namespace', create_channel_fn=_CreateFakeChannel)
Ejemplo n.º 4
0
 def setUp(self):
     test_util.InitAppHostingApi()
     self._tree = datastore_tree.DatastoreTree()
     self._application = shell.MakeShellApp(self._tree, 'TEST')
     # these are updated after StartResponse is called
     self._status = None
     self._headers = None
     self._output = ''
Ejemplo n.º 5
0
 def testClear(self):
     self._tree.Clear()
     self.assertFalse(self._tree.HasFile('/foo'))
     self.assertFalse(self._tree.HasFile('/bar'))
     self.assertFalse(self._tree.HasFile('/foobar'))
     # check that changes persist to a new instance
     tree = datastore_tree.DatastoreTree()
     self.assertFalse(tree.HasFile('/foo'))
     self.assertFalse(tree.HasFile('/bar'))
     self.assertFalse(tree.HasFile('/foobar'))
Ejemplo n.º 6
0
 def testSetFile(self):
     self._tree.SetFile('/foo', 'xyz')
     self.assertEquals('xyz', self._tree.GetFileContents('/foo'))
     # check that changes persist to a new instance
     tree = datastore_tree.DatastoreTree()
     self.assertEquals('xyz', tree.GetFileContents('/foo'))
Ejemplo n.º 7
0
 def _CreateTree(self, namespace, access_key):
   tree = datastore_tree.DatastoreTree(namespace, access_key)
   for path, contents in self._files.items():
     tree.SetFile(path, contents)
   return tree