def test_get_location():
    """Tests an API call to get a location"""

    t = Touchpoint(api_key=API_KEY)
    resp = t.get_location(store_id=TEST_STORE_ID)

    assert isinstance(resp, Touchpoint.Location)
def test_get_item():
    """Tests an API call to get a store's employees"""

    t = Touchpoint(api_key=API_KEY)
    resp = t.get_item(store_id=TEST_STORE_ID, item_id=TEST_ITEM_ID)

    assert isinstance(resp, Touchpoint.Item)
def test_get_employee():
    """Tests an API call to get a store's employees"""

    t = Touchpoint(api_key=API_KEY)
    resp = t.get_employee(store_id=TEST_STORE_ID, employee_id=TEST_EMPLOYEE_ID)

    assert isinstance(resp, Touchpoint.Employee)
def test_ping_full():
    """Tests an API call to API's endpoint"""
    t = Touchpoint(api_key=API_KEY)
    resp = t.ping_full()
    assert isinstance(resp, str)
    assert "status" in resp, "The response should include status."
    assert "error" in resp, "The response should incude error."
    assert "data" in resp, "The response should include data."
def test_item_info():
    """Tests an API call to get an location's info"""
    t = Touchpoint(api_key=TEST_API_KEY)

    item = t.Item(item_id='test~1001')
    resp = item.info()

    assert isinstance(resp, dict)
    assert resp['item_id'] is 'test~1001', "The ID should be in the response"
def test_get_items():
    """Tests an API call to get a store's items"""

    t = Touchpoint(api_key=API_KEY)
    resp = t.get_items(store_id=TEST_STORE_ID)

    assert isinstance(resp, list)
    assert isinstance(resp[0],
                      Touchpoint.Item), "The type of items should be Item."
def test_get_employees():
    """Tests an API call to get a store's employees"""

    t = Touchpoint(api_key=API_KEY)
    resp = t.get_employees(store_id=TEST_STORE_ID)

    assert isinstance(resp, list)
    assert isinstance(
        resp[0],
        Touchpoint.Employee), "The type of employees should be Employee."
def test_employee_info():
    """Tests an API call to get an employee's info"""
    t = Touchpoint(api_key=TEST_API_KEY)

    employee = t.Employee(employee_id=1396, first_name="Zappo", last_name="Z")
    resp = employee.info()

    assert isinstance(resp, dict)
    assert resp['employee_id'] == 1396, "The ID should be in the response"
    assert resp[
        'first_name'] == "Zappo", "The first name should be in the response"
    assert resp['last_name'] == "Z", "The first name should be in the response"
def test_location_info():
    """Tests an API call to get an location's info"""
    t = Touchpoint(api_key=TEST_API_KEY)

    location = t.Location(location_id='test-1001',
                          wss_url='',
                          default_order_notes=None,
                          name=None,
                          address=None,
                          phone=None)
    resp = location.info()

    assert isinstance(resp, dict)
    assert resp[
        'location_id'] is 'test-1001', "The ID should be in the response"
def test_ping():
    """Tests an API call to API's endpoint"""
    t = Touchpoint(api_key=API_KEY)
    resp = t.ping()
    assert isinstance(resp, int)