buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_atscustom.py
author wbernard
Sun, 10 Oct 2010 15:22:15 +0300
changeset 645 b8d81fa19e7d
parent 588 c7c26511138f
permissions -rw-r--r--
helium_12.0.0-63b64366f9cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     1
#============================================================================ 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     2
#Name        : test_atsant.py 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     3
#Part of     : Helium 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     4
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     5
#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     6
#All rights reserved.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     7
#This component and the accompanying materials are made available
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     8
#under the terms of the License "Eclipse Public License v1.0"
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     9
#which accompanies this distribution, and is available
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    10
#at the URL "http://www.eclipse.org/legal/epl-v10.html".
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    11
#
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    12
#Initial Contributors:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    13
#Nokia Corporation - initial contribution.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    14
#
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    15
#Contributors:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    16
#
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    17
#Description:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    18
#===============================================================================
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    19
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    20
""" ats3 custom.py module tests. """
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    21
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    22
import tempfile
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    23
import os
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    24
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    25
class Bunch(object):
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    26
    """ Configuration object. Argument from constructor are converted into class attributes. """
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    27
    def __init__(self, **kwargs):
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    28
        self.__dict__.update(kwargs)
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    29
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    30
def test_atscustom():
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    31
    import ats3
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    32
    import ats3.custom
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    33
    output = os.path.join(tempfile.mkdtemp(), 'ATS3Drop.zip')
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    34
    opts = Bunch(file_store='', flash_images='', diamonds_build_url='', testrun_name='', device_type='', report_email='', test_timeout='', drop_file=output, config_file='')
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    35
    config = ats3.Configuration(opts, [])
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    36
    ats3.custom.create_drop(config)
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    37
    assert os.path.exists(output)