예제 #1
0
def test_rand():
    possible = ["one", "two", "three"]
    string = "one two three"
    output = rand(string)
    assert output in possible
예제 #2
0
""")

COMPANY_NAME_EXTRA = u("""
media designs collective systems labs
""")

########NEW FILE########
__FILENAME__ = patterns
import random

from faker import data
from faker.utils import rand

CITY = lambda: random.choice([
    " ".join([
        rand(data.CITY_PREFIX), "".join(
            [rand(data.FIRST_NAMES),
             rand(data.CITY_SUFFIX)])
    ]),
    " ".join([rand(data.CITY_PREFIX),
              rand(data.FIRST_NAMES)]),
    "".join([rand(data.FIRST_NAMES),
             rand(data.CITY_SUFFIX)]),
    "".join([rand(data.LAST_NAMES),
             rand(data.CITY_SUFFIX)]),
])

STREET_NAME = lambda: random.choice([
    " ".join([rand(data.LAST_NAMES),
              rand(data.STREET_SUFFIX)]), " ".join(
                  [rand(data.FIRST_NAMES),
예제 #3
0
def domain():
    return rand(data.FREE_EMAIL)
예제 #4
0
 def _get_names(self):
     self._names = [rand(data.FIRST_NAMES), rand(data.LAST_NAMES)]
     self._name_accesses = set()
예제 #5
0
 def state(self):
     return rand(data.STATE_ABBR)
예제 #6
0
파일: __init__.py 프로젝트: ddub/faker
 def state(self):
     return rand(data.STATE_ABBR)
예제 #7
0
파일: __init__.py 프로젝트: ddub/faker
 def _get_names(self):
     self._names = [rand(data.FIRST_NAMES), rand(data.LAST_NAMES)]
     self._name_accesses = set()
예제 #8
0
파일: patterns.py 프로젝트: KB9/Zombaez
import random

from faker import data
from faker.utils import rand



CITY = lambda: random.choice([
    " ".join([rand(data.CITY_PREFIX), "".join([rand(data.FIRST_NAMES), rand(data.CITY_SUFFIX)])]),
    " ".join([rand(data.CITY_PREFIX), rand(data.FIRST_NAMES)]),
    "".join([rand(data.FIRST_NAMES), rand(data.CITY_SUFFIX)]),
    "".join([rand(data.LAST_NAMES), rand(data.CITY_SUFFIX)]),
])

STREET_NAME = lambda: random.choice([
    " ".join([rand(data.LAST_NAMES), rand(data.STREET_SUFFIX)]),
    " ".join([rand(data.FIRST_NAMES), rand(data.STREET_SUFFIX)])
])

COMPANY_NAME = lambda: random.choice([
    "".join([rand(data.COMPANY_NAME_PREFIX), rand(data.COMPANY_NAME_SUFFIX)]),
    "".join([rand(data.COMPANY_NAME_PREFIX).capitalize(), rand(data.COMPANY_NAME_SUFFIX)]),
    "".join([rand(data.COMPANY_NAME_PREFIX).capitalize(), rand(data.COMPANY_NAME_SUFFIX).capitalize()]),
    "%s %s" % ("".join([rand(data.COMPANY_NAME_PREFIX).capitalize(), rand(data.COMPANY_NAME_SUFFIX)]), rand(data.COMPANY_NAME_EXTRA).capitalize())
])