configurationengine/source/cone/storage/tests/unittest_filestorage_layer.py
author m2lahtel
Tue, 10 Aug 2010 14:29:28 +0300
changeset 3 e7e0ae78773e
parent 0 2e8eeb919028
permissions -rw-r--r--
ConE 1.2.11 release

#
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description: 
#

"""
Test the configuration
"""
import unittest
import os

from cone.storage import filestorage, zipstorage
from cone.public.tests import unittest_layer
from testautomation.utils import remove_if_exists

ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
LAYER_TMP_FOLDER = os.path.join(ROOT_PATH, "temp/layertest")
LAYER_TMP_ZIP = os.path.join(ROOT_PATH, "temp/layertest.zip")

##########################################################################
# FileStorage tests for folder and layer actions

class TestFolderOnFileStorage(unittest_layer.TestFolder):
    def setUp(self):
        self.store = filestorage.FileStorage(LAYER_TMP_FOLDER,"w")

    def tearDown(self):
        remove_if_exists(LAYER_TMP_FOLDER)

class TestLayerOnFileStorage(unittest_layer.TestLayer):
    def setUp(self):
        self.store = filestorage.FileStorage(LAYER_TMP_FOLDER,"w")

    def tearDown(self):
        remove_if_exists(LAYER_TMP_FOLDER)

class TestCompositeLayerOnFileStorage(unittest_layer.TestCompositeLayer):
    def setUp(self):
        self.store = filestorage.FileStorage(LAYER_TMP_FOLDER,"w")

    def tearDown(self):
        remove_if_exists(LAYER_TMP_FOLDER)

##########################################################################
# ZipStorage


#class TestFolderOnZipStorage(unittest_layer.TestFolder):
#    def setUp(self):
#        self.store = zipstorage.ZipStorage(LAYER_TMP_ZIP,"w")
#
#    def tearDown(self):
#        self.store.close()
#        remove_if_exists(LAYER_TMP_ZIP)
#
#class TestLayerOnZipStorage(unittest_layer.TestLayer):
#    def setUp(self):
#        self.store = zipstorage.ZipStorage(LAYER_TMP_ZIP,"w")
#
#    def tearDown(self):
#        self.store.close()
#        remove_if_exists(LAYER_TMP_ZIP)
#
#class TestCompositeLayerOnZipStorage(unittest_layer.TestCompositeLayer):
#    def setUp(self):
#        self.store = zipstorage.ZipStorage(LAYER_TMP_ZIP,"w")
#
#    def tearDown(self):
#        self.store.close()
#        remove_if_exists(LAYER_TMP_ZIP)


if __name__ == '__main__':
    unittest.main()