forked from klen/mixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_faker.py
47 lines (31 loc) · 985 Bytes
/
test_faker.py
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
def test_faker():
from mixer._faker import faker
assert faker.choices()
assert len(faker.choices(length=5)) == 5
assert faker.big_integer()
assert faker.ip_generic()
assert faker.positive_decimal()
assert faker.positive_decimal() > 0
assert faker.positive_integer()
assert faker.positive_integer() > 0
assert faker.small_integer()
assert faker.small_positive_integer()
assert faker.small_positive_integer() > 0
assert faker.uuid()
assert 0 <= faker.percent() <= 100
assert faker.percent_decimal()
assert faker.title()
assert faker.coordinates()
import datetime
assert faker.datetime()
assert faker.datetime('2010-01-02') > datetime.datetime(2010, 1, 1)
env = faker.env
name = faker.name
faker.locale = 'ru'
assert name()
assert faker.name()
faker.locale = 'en'
assert faker.name()
assert faker.env is env
assert faker.email()
assert faker.pybytes()