Example #1
0
 def test_workspace_creation(self):
     workspace = Workspace(name="workspace_test")
     self.wmapper.save(workspace)
     w = self.wmapper.find(workspace.getID())
     self.assertEquals(
         w, workspace,
         "Workspace retrieved should be the same as persisted")
     self.assertEquals(
         w.getID(), workspace.getID(),
         "Workspace retrieved's Id should be the same as persisted's Id")
Example #2
0
 def test_workspace_creation(self):
     workspace = Workspace(name="workspace_test")
     self.wmapper.save(workspace)
     w = self.wmapper.find(workspace.getID())
     self.assertEquals(
         w,
         workspace,
         "Workspace retrieved should be the same as persisted")
     self.assertEquals(
         w.getID(),
         workspace.getID(),
         "Workspace retrieved's Id should be the same as persisted's Id")
Example #3
0
 def test_workspace_serialization(self):
     workspace = Workspace(name="workspace_test")
     workspace.setDescription("Some description")
     workspace.setCustomer("Infobyte")
     wserialized = self.wmapper.serialize(workspace)
     # if serialization fails, returns None
     self.assertNotEqual(
         wserialized,
         None,
         "Serialized workspace shouldn't be None")
     # we check the host attributes
     self.assertEquals(
         wserialized.get("_id"),
         workspace.getID(),
         "Serialized ID is not the same as workspace ID")
     self.assertEquals(
         wserialized.get("name"),
         workspace.getName(),
         "Serialized name is not the same as workspace name")
     self.assertEquals(
         wserialized.get("description"),
         workspace.getDescription(),
         "Serialized description is not the same as workspace description")
     self.assertEquals(
         wserialized.get("customer"),
         workspace.getCustomer(),
         "Serialized customer is not the same as workspace customer")
Example #4
0
    def test_workspace_create_and_delete(self):
        workspace = Workspace(name="workspace_test")
        self.wmapper.save(workspace)
        w_id = workspace.getID()

        self.assertNotEquals(self.wmapper.load(w_id), None,
                             "Workspace should be saved")

        self.wmapper.delete(w_id)

        self.assertEquals(self.wmapper.find(w_id), None,
                          "Workspace shouldn't exist anymore")
Example #5
0
    def test_workspace_create_and_delete(self):
        workspace = Workspace(name="workspace_test")
        self.wmapper.save(workspace)
        w_id = workspace.getID()

        self.assertNotEquals(
            self.wmapper.load(w_id),
            None,
            "Workspace should be saved")

        self.wmapper.delete(w_id)

        self.assertEquals(
            self.wmapper.find(w_id),
            None,
            "Workspace shouldn't exist anymore")