Exemple #1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import picka

print picka.phone_number()
print picka.last_name()
print picka.random_string(8)
print picka.sentence()
print picka.sentence_actual()
assert picka.sentence_actual(86, 93)  == (
"""\
A shock of orange hair a pale face disfigured by a horrible scar which by its contraction has turned up the outer edge of his upper lip a bulldog chin and a pair of very penetrating dark eyes which present a singular contrast to the colour of his hair all mark him out from amid the common crowd of mendicants and so too does his wit for he is ever ready with a reply to any piece of chaff which may be thrown at him by the passers-by."""
)
print picka.timezone_offset()
print picka.language()
print picka.timezone_offset_country()
print picka.screename()
print picka.number(10)
print picka.month()
print picka.month_and_day_and_year()
print picka.special_characters(8)
print picka.postal_code()
print picka.apartment_number()
print picka.gender()
print picka.salutation()
print picka.creditcard('visa')
print picka.male_middle_name()
print picka.city()
print picka.male_full_name_w_middle_initial()
print picka.state_abbreviated()
print picka.street_name()
Exemple #2
0
    Returns tuple, left is suffix, right is media type/subtype.
    """
    return tuple(
        linecache.getline(
            os.path.join(os.path.abspath(os.path.dirname(__file__)),
                         'mimes.csv'),
            _random.randrange(0, 647)).strip("\n").split(','))


########NEW FILE########
__FILENAME__ = tests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import picka

assert picka.phone_number()
assert picka.last_name()
assert picka.random_string(8)
assert picka.sentence()
assert picka.sentence_actual()
assert picka.timezone_offset()
assert picka.language()
assert picka.timezone_offset_country()
assert picka.screename()
assert picka.number(10)
assert picka.month()
assert picka.month_and_day_and_year()
assert picka.special_characters(8)
assert picka.postal_code()
assert picka.apartment_number()
assert picka.gender()
Exemple #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import picka

assert picka.phone_number()
assert picka.last_name()
assert picka.random_string(8)
assert picka.sentence()
assert picka.sentence_actual()
assert picka.timezone_offset()
assert picka.language()
assert picka.timezone_offset_country()
assert picka.screename()
assert picka.number(10)
assert picka.month()
assert picka.month_and_day_and_year()
assert picka.special_characters(8)
assert picka.postal_code()
assert picka.apartment_number()
assert picka.gender()
assert picka.salutation()
assert picka.creditcard('visa')
assert picka.male_middle_name()
assert picka.city()
assert picka.male_full_name_w_middle_initial()
assert picka.state_abbreviated()
assert picka.street_name()
assert picka.initial()
assert picka.calling_code_with_country()
assert picka.surnames()
assert picka.business_title()
from boston_restaurant.model.reservation import Reservation
from boston_restaurant.model.food import Food
from boston_restaurant.model.user import User
from boston_restaurant.model.menu import Menu
from boston_restaurant import db

users = []
restaurants = []
reviews = []
foods = []
menus = []
RATING_LEVELS = ['Good', 'Average', 'Bad']
MENU_TYPES = ['Brunch', 'Lunch', 'Dinner']
for i in range(5):
    user = User(nickname=picka.name(), username=picka.email(),
                password='******', phone=picka.phone_number())
    db.session.add(user)
    users.append(user)

db.session.commit()

for line in open('food.txt'):
    parts = line.split('/')
    if len(parts) > 1:
        name, desc = parts[0], parts[1][:140]
    else:
        name, desc = parts[0], ''
    food = Food(name=name, description=desc)
    foods.append(food)

Exemple #5
0
def test_phone_number_with_state():
    a = phone_number("NY")
    assert bool(match(r"\b\w{2}\b", a.state))
Exemple #6
0
def test_phone_number():
    assert len(phone_number().items()) > 1
Exemple #7
0
def test_phone_number_standard():
    a = phone_number()
    assert bool(match(r"\d{3}-\d{3}-\d{4}", a.standard))
Exemple #8
0
def test_phone_number_plain():
    a = phone_number()
    assert bool(match(r"\d{10}", a.plain))
Exemple #9
0
def test_phone_number_local():
    a = phone_number()
    assert bool(match(r"\d{3}-\d{4}", a.local))
Exemple #10
0
def test_phone_number_international():
    a = phone_number()
    assert bool(match(r"\+1\-\d{3}-\d{3}[-]?\d{4}\b", a.international))
Exemple #11
0
def test_phone_number_domestic():
    a = phone_number()
    assert bool(match(r"\(\d{3}\) \b\d{3}[-]?\d{4}\b", a.domestic))