Ejemplo n.º 1
0
def test_syncact_listid():
    """ add sync action with specified action and list_id """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    bulk.add_syncaction_list(action='add', list_id=12345)
    assert bulk.job['options']['syncActions'][0] == {
        "action": "add",
        "destination": "{{ContactList[12345]}}"
    }
Ejemplo n.º 2
0
def test_syncact_listname_call(mock_get):
    """ api call with specified action and list_name """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = GOOD_LIST_NAME
    bulk.add_syncaction_list(action='add', list_name='Test List 1')
    mock_get.assert_called_with(url=bulk.bulk_base + '/contacts/lists?q="name=Test*List*1"',
                                auth=bulk.auth)
Ejemplo n.º 3
0
def test_syncact_listid():
    """ add sync action with specified action and list_id """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    bulk.add_syncaction_list(action='add', list_id=12345)
    assert bulk.job['options']['syncActions'][0] == {
        "action": "add",
        "destination": "{{ContactList[12345]}}"
    }
Ejemplo n.º 4
0
def test_syncact_listname_call(mock_get):
    """ api call with specified action and list_name """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = GOOD_LIST_NAME
    bulk.add_syncaction_list(action='add', list_name='Test List 1')
    mock_get.assert_called_with(url=bulk.bulk_base +
                                '/contacts/lists?q="name=Test*List*1"',
                                auth=bulk.auth)
Ejemplo n.º 5
0
def test_syncact_listname(mock_get):
    """ add sync action with specified action and list_name """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = GOOD_LIST_NAME
    bulk.add_syncaction_list(action='add', list_name='Test List 1')
    assert bulk.job['options']['syncActions'][0] == {
        "action": "add",
        "destination": "{{ContactList[1]}}"
    }
Ejemplo n.º 6
0
def test_syncact_listname(mock_get):
    """ add sync action with specified action and list_name """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = GOOD_LIST_NAME
    bulk.add_syncaction_list(action='add', list_name='Test List 1')
    assert bulk.job['options']['syncActions'][0] == {
        "action": "add",
        "destination": "{{ContactList[1]}}"
    }