acceptance_test_utils.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 #
5 # Copyright © 2018 Pilz GmbH & Co. KG
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 # http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 
19 # Asks the user permission to start the test.
20 def _askPermission(test_name):
21  s = raw_input('Perform ' + test_name + ' [(y)es, (n)o]?: ')
22  if(s == "n"):
23  print('\n\nSkip ' + test_name + '\n___TEST-END___\n')
24  return 0
25  print('\n\nStart ' + test_name + '\n')
26  return 1
27 
28 # Asks the user if the test was successful and (if given) displays
29 # a hint regarding the assessment of a successful test.
30 def _askSuccess(test_name, question=None):
31  if (question != None):
32  print('\nTest ' + test_name + ' successful?')
33  print('Hint: \n' + question)
34 
35  s = raw_input('Test ' + test_name + ' successful [(y)es, (n)o]?: ')
36  if(s == "n"):
37  print('\nTest ' + test_name + ' failed!\n___TEST-END___\n')
38  return 0
39  print('Test ' + test_name + ' successful.\n___TEST-END___\n')
40  return 1


pilz_industrial_motion_testutils
Author(s):
autogenerated on Mon Apr 6 2020 03:17:28