<commit_before>require 'helper'

class TestApiPostcodeNl < Test::Unit::TestCase
  context 'API.address' do
    setup do
      ApiPostcodeNl::API.key = 'some-api-key'
      ApiPostcodeNl::API.secret = 'super-secret'
    end

    should 'handle non-numerical house numbers when house_number_addition is nil' do
      ApiPostcodeNl::API.address('1000AA', 'Foo')
    end
  end
end<commit_msg>Make tests not access the live API<commit_after>require 'helper'

class TestApiPostcodeNl < Test::Unit::TestCase
  class DummyFetcher
    def fetch(*_)
      OpenStruct.new(body: '{}')
    end
  end

  context 'API.address' do
    setup do
      ApiPostcodeNl::API.fetcher = DummyFetcher.new

      ApiPostcodeNl::API.key = 'some-api-key'
      ApiPostcodeNl::API.secret = 'super-secret'
    end

    should 'handle non-numerical house numbers when house_number_addition is nil' do
      ApiPostcodeNl::API.address('1000AA', 'Foo')
    end
  end
end
{'fraction_non_alphanumeric': 0.10458911419423693, 'fraction_numerical': 0.008537886872998933, 'mean_word_length': 3.531400966183575, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5873453', 'n_tokens_mistral': 323, 'n_tokens_neox': 310, 'n_words': 74}