@@ -0,0 +1,910 @@
+from ntp.data.api import return_sanitized, filter_grouped, group_all %0Afrom pprint import pprint%0Afrom time import sleep%0A%0Adef test_return_sanitized():%0A    %22%22%22%0A    Runs full retrieval of data from ODP to grouping step.%0A    %22%22%22%0A    data = return_sanitized()%0A    assert data%0A    assert isinstance(data, list)%0A    assert all(isinstance(elem, dict) for elem in data)%0A    assert all(%22annual_salary%22 in elem for elem in data)%0A    return data%0A%0Adef test_group_all():%0A    %22%22%22%0A    Ensure the major data manipulation is occurring as expected.%0A    %22%22%22%0A    # Sleep for a few seconds so as to not upset the API request limit%0A    sanitized = test_return_sanitized()%0A    grouped = group_all(sanitized)%0A%0A    for key in %5B%22name%22, %22ethnicity%22, %22gender%22%5D:%0A        assert all(key in elem for elem in grouped)%0A%0A    departments = %5Belem%5B%22name%22%5D for elem in grouped%5D%0A    assert len(departments) == len(set(departments))%0A    return grouped%0A

Initial data.api tests in place.