Merge "criteria field must be 'PASS/FAIL'"
[releng.git] / utils / test / testapi / opnfv_testapi / common / message.py
1 ##############################################################################
2 # Copyright (c) 2017 ZTE Corp
3 # feng.xiaowei@zte.com.cn
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 not_found_base = 'Could Not Found'
10 exist_base = 'Already Exists'
11
12
13 def key_error(key):
14     return "KeyError: '{}'".format(key)
15
16
17 def no_body():
18     return 'No Body'
19
20
21 def not_found(key, value):
22     return '{} {} [{}]'.format(not_found_base, key, value)
23
24
25 def missing(name):
26     return '{} Missing'.format(name)
27
28
29 def invalid_value(name, options):
30     return '{} must be in {}'.format(name, options)
31
32
33 def exist(key, value):
34     return '{} [{}] {}'.format(key, value, exist_base)
35
36
37 def bad_format(error):
38     return 'Bad Format [{}]'.format(error)
39
40
41 def unauthorized():
42     return 'No Authentication Header'
43
44
45 def invalid_token():
46     return 'Invalid Token'
47
48
49 def not_login():
50     return 'TestAPI id is not provided'
51
52
53 def not_lfid():
54     return 'Not a valid Linux Foundation Account'
55
56
57 def no_update():
58     return 'Nothing to update'
59
60
61 def must_int(name):
62     return '{} must be int'.format(name)