---

test_name: Test analytics endpoints for different roles

marks:
  - usefixtures:
      - service_host
  - parametrize:
      key:
        - service
        - profile
        - role
        - status
      vals:
        - [ows-grass, LabelProfile, analytics, 308]
        - [ows-grass, LabelProfile, admin, 308]
        - [ows-grass, OrchAdminProfile, admin, 308]
        - [ows-grass, LabelProfile, masterrights, 403]
        - [ows-grass, LabelProfile, accounting, 403]
        - [ows-grass, LabelProfile, catalog, 403]
        - [ows-product, LabelProfile, catalog, 308]
  - parametrize:
      key: endpoint
      vals:
        - geographic-orchard-regions
        - geographics-latest-date
        - geographic-insights-by-territory
        - geographic-insights-by-region
        - demographic_insights
        - stream-charts
        - playlist-placements
        - playlist-metadata

stages:
  - name: Should return the correct status code for different roles
    request:
      url: "{service_host}{endpoint}"
      method: GET
      headers:
        orchard-account-type: "label"
        orchard-account-id: "alw:70787"
        orchard-profile-id: "70787"
        orchard-profile-type: "{profile}"
        orchard-roles: "{role}"
        orchard-requestor-service: "{service}"
    response:
      status_code: !int "{status}"
