diff -r 000000000000 -r 2e8eeb919028 configurationengine/source/plugins/common/ConeContentPlugin/contentplugin/tests/unittest_content_copy.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configurationengine/source/plugins/common/ConeContentPlugin/contentplugin/tests/unittest_content_copy.py Thu Mar 11 17:04:37 2010 +0200 @@ -0,0 +1,46 @@ +# +# 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: +# + +import unittest, os +import pkg_resources +try: + pkg_resources.require('ConeContentPlugin') +except pkg_resources.DistributionNotFound: + import __init__ + +from cone.public.exceptions import NotSupportedException +from contentplugin import contentml + +class TestCreateContentPlugin(unittest.TestCase): + def test_create_content_impl(self): + imp = contentml.ContentImpl('test.content',None) + pass + +class TestContentImplementation(unittest.TestCase): + def setUp(self): + self.imp = contentml.ContentImpl('test.content',None) + pass + + def test_content_filter(self): + files = ['aaa.txt', 'bbb.txt'] + filesfunc = lambda x: x.lower() in [file.lower() for file in files] + self.assertEquals(filesfunc('aaa'), False) + self.assertEquals(filesfunc('AAA'), False) + self.assertEquals(filesfunc('AAA.txt'), True) + self.assertEquals(filesfunc('aaa.txt'), True) + +if __name__ == '__main__': + unittest.main()