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 Respource
|
|
19 |
"""
|
|
20 |
import unittest
|
|
21 |
import string
|
|
22 |
import sys,os
|
|
23 |
import __init__
|
|
24 |
|
|
25 |
from cone.public.api import Resource
|
|
26 |
from cone.storage.stringstorage import StringResource
|
|
27 |
|
|
28 |
class TestResource(unittest.TestCase):
|
|
29 |
def setUp(self):
|
|
30 |
pass
|
|
31 |
|
|
32 |
def test_create_resource(self):
|
|
33 |
res = Resource("","",None)
|
|
34 |
self.assertTrue(res)
|
|
35 |
|
|
36 |
class TestStringResource(unittest.TestCase):
|
|
37 |
def setUp(self):
|
|
38 |
pass
|
|
39 |
|
|
40 |
def test_create_stringresource_with_data(self):
|
|
41 |
res = StringResource("","","Test data")
|
|
42 |
self.assertTrue(res)
|
|
43 |
self.assertEqual(res.read(),"Test data")
|
|
44 |
|
|
45 |
|
|
46 |
if __name__ == '__main__':
|
|
47 |
unittest.main()
|
|
48 |
|