-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsamples.py
More file actions
78 lines (69 loc) · 1.58 KB
/
Copy pathsamples.py
File metadata and controls
78 lines (69 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : mocobk
# @Email : mailmzb@qq.com
# @Time : 2020/8/18 20:16
from pprint import pprint
from pymock import Mock
Mock = Mock()
pprint(Mock.mock('@csentence 变量示例'))
pprint(Mock.mock({
'list|1-10': [{
'id|+1': 1,
'email': '@EMAIL'
}]
}))
pprint(Mock.mock(Mock.mock({
'number1|1-100.1-10': 1,
'number2|123.1-10': 1,
'number3|123.3': 1,
'number4|123.10': 1.123
})))
pprint(Mock.mock({
'regexp1': r'/[a-z][A-Z][0-9]/',
'regexp2': r'/\w\W\s\S\d\D/',
'regexp3': r'/\d{5,10}/',
'regexp4': r'\/\d{5,10}\/' # output raw regexp with escape slash
}))
pprint(Mock.mock({
'name': {
'first': '@first',
'middle': '@first',
'last': '@last',
'email': 'example\\@gmail.com',
'full': '@first @middle @last'
}
}
))
pprint(Mock.mock_js("""
{
name: {
first: "@cfirst",
last: "@clast",
name: "@first@last",
}
}
"""))
pprint(Mock.mock({
'random': {
'name': [
'@name',
'@cname'
],
'image': [
# @image( size, background, foreground, format, text )
"@image",
"@image('300x400')",
"@image('300x400', '占位图文字')",
"@image('300x400', '#234567', '#FFFFFF', 'png', 'HelloWorld')"
],
'emoji': [
# emoji( pool, min, max )
"@emoji",
"@emoji('😀😁😂😃😄')",
"@emoji(1, 3)",
"@emoji('123🌘😷🙊★♠♫', 3, 6)"
]
}
}
))