<commit_before>var common = require('../../../common');
var expect = common.expect;
var endpoint = '/api/v1/module/promote';

common.post(
    'should create new production module config',
    endpoint,
    {
        preloaded_pt: true,
        exchange_after_x_ignition_cycles: 20,
        exchange_after_x_kilometers: 777,
        exchange_after_x_days: 30,
        timeout_after_x_seconds: 15,
        seconds_between_retries: [ 10, 30, 90 ],
        endpoints: {
            '0x04': 'http://localhost:3000/api/1/softwareUpdate',
            queryAppsUrl: 'http://localhost:3000/api/1/queryApps',
            lock_screen_icon_url: 'https://i.imgur.com/TgkvOIZ.png'
        },
        notifications_per_minute_by_priority: {
            EMERGENCY: 60,
            NAVIGATION: 5,
            VOICECOM: 5,
            COMMUNICATION: 5,
            NORMAL: 5,
            NONE: 0
        }
    },
    (err, res, done) => {
        expect(err).to.be.null;
        expect(res).to.have.status(200);
        done();
    }
);


common.get(
  'check lock_screen_dismissal_enabled defaults to false',
  `/api/v1/module`,
  {
  },
  (err, res, done) => {
      expect(res).to.have.status(200);
      expect(res.body.data.module_configs).to.have.lengthOf(1);
      expect(res.body.data.module_configs[0].lock_screen_dismissal_enabled).to.be.equal(false);
      done();
  }
);


common.post(
  'should create new production module config lock_screen_dismissal_enabled',
  endpoint,
  {
      preloaded_pt: true,
      exchange_after_x_ignition_cycles: 20,
      exchange_after_x_kilometers: 777,
      exchange_after_x_days: 30,
      timeout_after_x_seconds: 15,
      seconds_between_retries: [ 10, 30, 90 ],
      endpoints: {
          '0x04': 'http://localhost:3000/api/1/softwareUpdate',
          queryAppsUrl: 'http://localhost:3000/api/1/queryApps',
          lock_screen_icon_url: 'https://i.imgur.com/TgkvOIZ.png'
      },
      notifications_per_minute_by_priority: {
          EMERGENCY: 60,
          NAVIGATION: 5,
          VOICECOM: 5,
          COMMUNICATION: 5,
          NORMAL: 5,
          NONE: 0
      },
      lock_screen_dismissal_enabled: true
  },
  (err, res, done) => {
      expect(err).to.be.null;
      expect(res).to.have.status(200);
      //not able to check output in post
      done();
  }
);


common.get(
  'check lock_screen_dismissal_enabled set to true',
  `/api/v1/module`,
  {
  },
  (err, res, done) => {
      expect(res).to.have.status(200);
      expect(res.body.data.module_configs).to.have.lengthOf(1);
      expect(res.body.data.module_configs[0].lock_screen_dismissal_enabled).to.be.equal(true);
      done();
  }
);

common.post(
    'should return 400 with no body specified',
    endpoint,
    {},
    (err, res, done) => {
        expect(err).to.be.null;
        expect(res).to.have.status(400);
        done();
    }
);<commit_msg>check production policy table for new fields<commit_after>var common = require('../../../common');
var expect = common.expect;
var endpoint = '/api/v1/module/promote';

common.post(
    'should create new production module config',
    endpoint,
    {
        preloaded_pt: true,
        exchange_after_x_ignition_cycles: 20,
        exchange_after_x_kilometers: 777,
        exchange_after_x_days: 30,
        timeout_after_x_seconds: 15,
        seconds_between_retries: [ 10, 30, 90 ],
        endpoints: {
            '0x04': 'http://localhost:3000/api/1/softwareUpdate',
            queryAppsUrl: 'http://localhost:3000/api/1/queryApps',
            lock_screen_icon_url: 'https://i.imgur.com/TgkvOIZ.png'
        },
        notifications_per_minute_by_priority: {
            EMERGENCY: 60,
            NAVIGATION: 5,
            VOICECOM: 5,
            COMMUNICATION: 5,
            NORMAL: 5,
            NONE: 0
        }
    },
    (err, res, done) => {
        expect(err).to.be.null;
        expect(res).to.have.status(200);
        done();
    }
);


common.get(
  'check lock_screen_dismissal_enabled defaults to false',
  `/api/v1/module`,
  {
  },
  (err, res, done) => {
      expect(res).to.have.status(200);
      expect(res.body.data.module_configs).to.have.lengthOf(1);
      expect(res.body.data.module_configs[0].lock_screen_dismissal_enabled).to.be.equal(false);
      done();
  }
);


common.post(
  'should create new production module config lock_screen_dismissal_enabled',
  endpoint,
  {
      preloaded_pt: true,
      exchange_after_x_ignition_cycles: 20,
      exchange_after_x_kilometers: 777,
      exchange_after_x_days: 30,
      timeout_after_x_seconds: 15,
      seconds_between_retries: [ 10, 30, 90 ],
      endpoints: {
          '0x04': 'http://localhost:3000/api/1/softwareUpdate',
          queryAppsUrl: 'http://localhost:3000/api/1/queryApps',
          lock_screen_icon_url: 'https://i.imgur.com/TgkvOIZ.png'
      },
      notifications_per_minute_by_priority: {
          EMERGENCY: 60,
          NAVIGATION: 5,
          VOICECOM: 5,
          COMMUNICATION: 5,
          NORMAL: 5,
          NONE: 0
      },
      lock_screen_dismissal_enabled: true
  },
  (err, res, done) => {
      expect(err).to.be.null;
      expect(res).to.have.status(200);
      //not able to check output in post
      done();
  }
);


common.get(
  'check lock_screen_dismissal_enabled set to true',
  `/api/v1/module`,
  {
  },
  (err, res, done) => {
      expect(res).to.have.status(200);
      expect(res.body.data.module_configs).to.have.lengthOf(1);
      expect(res.body.data.module_configs[0].lock_screen_dismissal_enabled).to.be.equal(true);
      done();
  }
);


common.post(
  '/api/v1/production/policy POST should return production policy table with lock_screen_dismissal_enabled set to true',
  `/api/v1/production/policy`,
  {
      policy_table: {
          app_policies: {},
          consumer_friendly_messages: {},
          device_data: {},
          functional_groupings: {},
          module_config: {},
          usage_and_error_counts: {}
      }
  },
  (err, res, done) => {
      expect(err).to.be.null;
      expect(res).to.have.status(200);
      // console.log(JSON.stringify(res.body,null,4));
      let policy_table = res.body.data[0].policy_table
      expect(policy_table.module_config.lock_screen_dismissal_enabled).to.be.equal(true);
      expect(policy_table.consumer_friendly_messages.messages.LockScreenDismissalWarning.languages['en-us']['textBody']).to.be.equal(`Swipe down to dismiss, acknowledging that you are not the driver`)
      done();
  }
);

common.post(
    'should return 400 with no body specified',
    endpoint,
    {},
    (err, res, done) => {
        expect(err).to.be.null;
        expect(res).to.have.status(400);
        done();
    }
);
{'fraction_non_alphanumeric': 0.1367228268972715, 'fraction_numerical': 0.02937229759952289, 'mean_word_length': 2.4329580348004094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3602256', 'n_tokens_mistral': 2449, 'n_tokens_neox': 2271, 'n_words': 365}