示例#1
0
def test_phone_number_areacode():
    a = areacode()
    assert len(a.areacode) == 3
    assert isinstance(a.areacode, unicode)
    assert 201 <= int(a.areacode) <= 989
    assert bool(match(r"\d{3}", a.areacode))
示例#2
0
def test_phone_number_areacode_with_state():
    a = areacode("AB")
    assert a.areacode in ["780", "403"]
    assert isinstance(a.areacode, unicode)
示例#3
0
def test_area_code_default():
    a = areacode()
    assert 201 <= int(a.areacode) <= 989
    assert len(a.state) == 2