Skip to content

Commit

Permalink
Merge branch 'master' of github.com:2degrees/hubspot-contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoruiz committed Mar 20, 2014
2 parents a689ccf + d884fbf commit e7e6f86
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions hubspot/contacts/_schemas/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
##############################################################################

from voluptuous import All
from voluptuous import Any
from voluptuous import Length
from voluptuous import Optional
from voluptuous import Schema
Expand All @@ -25,19 +26,16 @@
from hubspot.contacts._schemas._validators import GetDictValue


_CANONICAL_IDENTITY_PROFILE_SCHEMA = {
'vid': int,
'identities': All(
[],
AnyListItemValidates(
Schema(
{'type': Constant(u'EMAIL'), 'value': unicode},
required=True,
extra=True,
),
_CANONICAL_IDENTITY_PROFILE_SCHEMA = All(
[],
AnyListItemValidates(
Schema(
{'type': Constant(u'EMAIL'), 'value': unicode},
required=True,
extra=True,
),
),
}
)

_IS_PROPERTY_VALUE = Schema({'value': unicode}, required=True, extra=True)

Expand All @@ -50,9 +48,11 @@
All(_IS_PROPERTY_VALUE, GetDictValue('value')),
),
'identity-profiles': All(
[{'vid': int, 'identities': []}],
[{
'vid': int,
'identities': Any([], _CANONICAL_IDENTITY_PROFILE_SCHEMA),
}],
Length(min=1),
AnyListItemValidates(_CANONICAL_IDENTITY_PROFILE_SCHEMA),
),
}],
'has-more': bool,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
from hubspot.contacts import get_all_contacts_by_last_update
from hubspot.contacts import save_contacts
from hubspot.contacts.formatters import format_contacts_data_for_saving
from hubspot.test_utils import MockPortalConnection

from tests.utils import BaseMethodTestCase
from tests.utils import RemoteMethod
from tests.utils.connection import MockPortalConnection
from tests.utils.contact import make_contact
from tests.utils.contact import make_contacts
from tests.utils.method_response_formatters.contacts_retrieval import \
Expand Down
2 changes: 1 addition & 1 deletion tests/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
from hubspot.contacts.properties import get_all_properties
from hubspot.contacts.properties import get_property_type_name
from hubspot.contacts.properties import get_raw_property_options
from hubspot.test_utils import MockPortalConnection

from tests.utils import BaseMethodTestCase
from tests.utils import RemoteMethod
from tests.utils.connection import MockPortalConnection
from tests.utils.generic import get_uuid4_str


Expand Down
2 changes: 1 addition & 1 deletion tests/test_property_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from hubspot.contacts.property_groups import PropertyGroup
from hubspot.contacts.property_groups import create_property_group
from hubspot.contacts.property_groups import get_all_property_groups
from hubspot.test_utils import MockPortalConnection

from tests.utils import BaseMethodTestCase
from tests.utils import RemoteMethod
from tests.utils.connection import MockPortalConnection
from tests.utils.generic import get_uuid4_str


Expand Down

0 comments on commit e7e6f86

Please sign in to comment.