configurationengine/source/plugins/common/ConeContentPlugin/contentplugin/tests/unittest_content_copy.py
changeset 0 2e8eeb919028
child 3 e7e0ae78773e
equal deleted inserted replaced
-1:000000000000 0:2e8eeb919028
       
     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 import unittest, os
       
    18 import pkg_resources 
       
    19 try:
       
    20     pkg_resources.require('ConeContentPlugin')
       
    21 except pkg_resources.DistributionNotFound:
       
    22     import __init__
       
    23     
       
    24 from cone.public.exceptions import NotSupportedException
       
    25 from contentplugin import contentml
       
    26 
       
    27 class TestCreateContentPlugin(unittest.TestCase):    
       
    28     def test_create_content_impl(self):
       
    29         imp = contentml.ContentImpl('test.content',None)
       
    30         pass
       
    31 
       
    32 class TestContentImplementation(unittest.TestCase):    
       
    33     def setUp(self):
       
    34         self.imp = contentml.ContentImpl('test.content',None)
       
    35         pass
       
    36 
       
    37     def test_content_filter(self):
       
    38         files = ['aaa.txt', 'bbb.txt']
       
    39         filesfunc = lambda x: x.lower() in [file.lower() for file in files]
       
    40         self.assertEquals(filesfunc('aaa'), False)
       
    41         self.assertEquals(filesfunc('AAA'), False)
       
    42         self.assertEquals(filesfunc('AAA.txt'), True)
       
    43         self.assertEquals(filesfunc('aaa.txt'), True)
       
    44 
       
    45 if __name__ == '__main__':
       
    46     unittest.main()