<commit_before>require 'spec_helper'

describe 'pixelated::apt::preferences' do
  let(:facts) do
      {
        :operatingsystem => 'Debian',
        :lsbdistid       => 'Debian',
        :lsbdistcodename => 'jessie',
      }
  end

    let(:pre_condition) { [
    "class apt {}",
    "define apt::sources_list($content='deb url') {}",
    "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}",
    ] }

  describe 'pixelated packages' do
    it { should contain_apt__preferences_snippet("pixelated").with_pin('origin "packages.pixelated-project.org"')}
    it { should contain_apt__preferences_snippet("pixelated").with_priority('1001')}
  end

  %w( soledad-server soledad-client soledad-common leap-keymanager leap-auth).each do | file |
    it { should contain_file("/etc/apt/preferences.d/#{file}").with_ensure('absent')}
  end

  %w( python-urllib3 python-requests python-six).each do | package |
    it { should contain_apt__preferences_snippet("#{package}").with_release(/jessie/) }
  end

end
<commit_msg>Fix apt-preferences test pinning<commit_after>require 'spec_helper'

describe 'pixelated::apt::preferences' do
  let(:facts) do
      {
        :operatingsystem => 'Debian',
        :lsbdistid       => 'Debian',
        :lsbdistcodename => 'jessie',
      }
  end

    let(:pre_condition) { [
    "class apt {}",
    "define apt::sources_list($content='deb url') {}",
    "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}",
    ] }

  describe 'pixelated packages' do
    it { should contain_apt__preferences_snippet("pixelated").with_pin('origin "packages.pixelated-project.org"')}
    it { should contain_apt__preferences_snippet("pixelated").with_priority('1000')}
  end

  %w( soledad-server soledad-client soledad-common leap-keymanager leap-auth).each do | file |
    it { should contain_file("/etc/apt/preferences.d/#{file}").with_ensure('absent')}
  end

  %w( python-urllib3 python-requests python-six).each do | package |
    it { should contain_apt__preferences_snippet("#{package}").with_release(/jessie/) }
  end

end

{'fraction_non_alphanumeric': 0.16082004555808657, 'fraction_numerical': 0.007289293849658315, 'mean_word_length': 4.343065693430657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '1349642', 'n_tokens_mistral': 750, 'n_tokens_neox': 723, 'n_words': 119}