diff options
Diffstat (limited to 'xtesting/samples')
-rw-r--r-- | xtesting/samples/HelloWorld.txt | 3 | ||||
-rw-r--r-- | xtesting/samples/__init__.py | 0 | ||||
-rw-r--r-- | xtesting/samples/first.py | 24 | ||||
-rw-r--r-- | xtesting/samples/fourth.py | 19 | ||||
-rw-r--r-- | xtesting/samples/second.py | 19 | ||||
-rw-r--r-- | xtesting/samples/testcases.yaml | 66 |
6 files changed, 131 insertions, 0 deletions
diff --git a/xtesting/samples/HelloWorld.txt b/xtesting/samples/HelloWorld.txt new file mode 100644 index 00000000..721c452b --- /dev/null +++ b/xtesting/samples/HelloWorld.txt @@ -0,0 +1,3 @@ +*** Test Cases *** +HelloWorld + Log ${var01} ${var02} diff --git a/xtesting/samples/__init__.py b/xtesting/samples/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/xtesting/samples/__init__.py diff --git a/xtesting/samples/first.py b/xtesting/samples/first.py new file mode 100644 index 00000000..60de3dc6 --- /dev/null +++ b/xtesting/samples/first.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 + +# pylint: disable=missing-docstring + +import time + +from xtesting.core import testcase + + +class Test(testcase.TestCase): + + def run(self, **kwargs): + self.start_time = time.time() + print "Hello World" + self.result = 100 + self.stop_time = time.time() + return testcase.TestCase.EX_OK diff --git a/xtesting/samples/fourth.py b/xtesting/samples/fourth.py new file mode 100644 index 00000000..be104fda --- /dev/null +++ b/xtesting/samples/fourth.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 + +# pylint: disable=missing-docstring + +import unittest + + +class TestStringMethods(unittest.TestCase): + + def test_upper(self): + self.assertEqual('Hello World'.upper(), + 'HELLO WORLD') diff --git a/xtesting/samples/second.py b/xtesting/samples/second.py new file mode 100644 index 00000000..36e1dd33 --- /dev/null +++ b/xtesting/samples/second.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 + +# pylint: disable=missing-docstring + +from xtesting.core import feature + + +class Test(feature.Feature): + + def execute(self, **kwargs): + print "Hello World" + return 0 diff --git a/xtesting/samples/testcases.yaml b/xtesting/samples/testcases.yaml new file mode 100644 index 00000000..86b0d279 --- /dev/null +++ b/xtesting/samples/testcases.yaml @@ -0,0 +1,66 @@ +tiers: + - + name: samples + order: 1 + ci_loop: 'daily' + description : '' + testcases: + - + case_name: first + project_name: xtesting + criteria: 100 + blocking: true + clean_flag: false + description: '' + dependencies: + installer: '' + scenario: '' + run: + module: 'first' + class: 'Test' + + - + case_name: second + project_name: xtesting + criteria: 100 + blocking: true + clean_flag: false + description: '' + dependencies: + installer: '' + scenario: '' + run: + module: 'second' + class: 'Test' + + - + case_name: third + project_name: xtesting + criteria: 100 + blocking: true + clean_flag: false + description: '' + dependencies: + installer: '' + scenario: '' + run: + module: 'xtesting.core.feature' + class: 'BashFeature' + args: + cmd: 'echo -n Hello World; exit 0' + + - + case_name: fourth + project_name: xtesting + criteria: 100 + blocking: true + clean_flag: false + description: '' + dependencies: + installer: '' + scenario: '' + run: + module: 'xtesting.core.unit' + class: 'Suite' + args: + name: 'fourth' |