0
|
1 |
#
|
|
2 |
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
# All rights reserved.
|
|
4 |
# This component and the accompanying materials are made available
|
|
5 |
# under the terms of "Eclipse Public License v1.0"
|
|
6 |
# which accompanies this distribution, and is available
|
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
#
|
|
9 |
# Initial Contributors:
|
|
10 |
# Nokia Corporation - initial contribution.
|
|
11 |
#
|
|
12 |
# Contributors:
|
|
13 |
#
|
|
14 |
# Description:
|
|
15 |
#
|
|
16 |
|
|
17 |
"""
|
|
18 |
Test the configuration
|
|
19 |
"""
|
|
20 |
import unittest
|
3
|
21 |
import os
|
0
|
22 |
|
3
|
23 |
from cone.storage import filestorage, zipstorage
|
|
24 |
from cone.public.tests import unittest_layer
|
|
25 |
from testautomation.utils import remove_if_exists
|
0
|
26 |
|
3
|
27 |
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
|
|
28 |
LAYER_TMP_FOLDER = os.path.join(ROOT_PATH, "temp/layertest")
|
|
29 |
LAYER_TMP_ZIP = os.path.join(ROOT_PATH, "temp/layertest.zip")
|
0
|
30 |
|
3
|
31 |
##########################################################################
|
|
32 |
# FileStorage tests for folder and layer actions
|
0
|
33 |
|
3
|
34 |
class TestFolderOnFileStorage(unittest_layer.TestFolder):
|
|
35 |
def setUp(self):
|
|
36 |
self.store = filestorage.FileStorage(LAYER_TMP_FOLDER,"w")
|
|
37 |
|
|
38 |
def tearDown(self):
|
|
39 |
remove_if_exists(LAYER_TMP_FOLDER)
|
0
|
40 |
|
3
|
41 |
class TestLayerOnFileStorage(unittest_layer.TestLayer):
|
|
42 |
def setUp(self):
|
|
43 |
self.store = filestorage.FileStorage(LAYER_TMP_FOLDER,"w")
|
0
|
44 |
|
3
|
45 |
def tearDown(self):
|
|
46 |
remove_if_exists(LAYER_TMP_FOLDER)
|
|
47 |
|
|
48 |
class TestCompositeLayerOnFileStorage(unittest_layer.TestCompositeLayer):
|
|
49 |
def setUp(self):
|
|
50 |
self.store = filestorage.FileStorage(LAYER_TMP_FOLDER,"w")
|
0
|
51 |
|
3
|
52 |
def tearDown(self):
|
|
53 |
remove_if_exists(LAYER_TMP_FOLDER)
|
0
|
54 |
|
3
|
55 |
##########################################################################
|
|
56 |
# ZipStorage
|
|
57 |
|
0
|
58 |
|
3
|
59 |
#class TestFolderOnZipStorage(unittest_layer.TestFolder):
|
|
60 |
# def setUp(self):
|
|
61 |
# self.store = zipstorage.ZipStorage(LAYER_TMP_ZIP,"w")
|
|
62 |
#
|
|
63 |
# def tearDown(self):
|
|
64 |
# self.store.close()
|
|
65 |
# remove_if_exists(LAYER_TMP_ZIP)
|
|
66 |
#
|
|
67 |
#class TestLayerOnZipStorage(unittest_layer.TestLayer):
|
|
68 |
# def setUp(self):
|
|
69 |
# self.store = zipstorage.ZipStorage(LAYER_TMP_ZIP,"w")
|
|
70 |
#
|
|
71 |
# def tearDown(self):
|
|
72 |
# self.store.close()
|
|
73 |
# remove_if_exists(LAYER_TMP_ZIP)
|
|
74 |
#
|
|
75 |
#class TestCompositeLayerOnZipStorage(unittest_layer.TestCompositeLayer):
|
|
76 |
# def setUp(self):
|
|
77 |
# self.store = zipstorage.ZipStorage(LAYER_TMP_ZIP,"w")
|
|
78 |
#
|
|
79 |
# def tearDown(self):
|
|
80 |
# self.store.close()
|
|
81 |
# remove_if_exists(LAYER_TMP_ZIP)
|
0
|
82 |
|
|
83 |
|
|
84 |
if __name__ == '__main__':
|
3
|
85 |
unittest.main()
|
|
86 |
|