<commit_before>require 'test_helper'

class ClientTest < Minitest::Test
  def setup
    @options = {
      client_id:        ENV.fetch('CLIENT_ID'),
      client_secret:    ENV.fetch('CLIENT_SECRET'),
      ip_address:       '127.0.0.1',
      fingerprint:      'test_fp',
      development_mode: true
    }
  end

  def test_configured_through_options
    client = SynapsePayRest::Client.new(@options)
    # these keys don't exist in config
    @options.delete(:development_mode)
    @options[:oauth_key] = ''
    assert_equal client.client.config, @options
    assert_equal client.client.config, @options
    assert_equal client.client.base_url, 'https://sandbox.synapsepay.com/api/3'
  end

  def test_endpoint_changes_when_development_mode_false
    @options[:development_mode] = false
    client = SynapsePayRest::Client.new(@options)
    assert_equal client.client.base_url, 'https://synapsepay.com/api/3'
  end<commit_msg>Fix failing tests by using correct "TEST_" prefix env vars<commit_after>require 'test_helper'

class ClientTest < Minitest::Test
  def setup
    @options = {
      client_id:        ENV.fetch('TEST_CLIENT_ID'),
      client_secret:    ENV.fetch('TEST_CLIENT_SECRET'),
      ip_address:       '127.0.0.1',
      fingerprint:      'test_fp',
      development_mode: true
    }
  end

  def test_configured_through_options
    client = SynapsePayRest::Client.new(@options)
    # these keys don't exist in config
    @options.delete(:development_mode)
    @options[:oauth_key] = ''
    assert_equal client.client.config, @options
    assert_equal client.client.config, @options
    assert_equal client.client.base_url, 'https://sandbox.synapsepay.com/api/3'
  end

  def test_endpoint_changes_when_development_mode_false
    @options[:development_mode] = false
    client = SynapsePayRest::Client.new(@options)
    assert_equal client.client.base_url, 'https://synapsepay.com/api/3'
  end
{'fraction_non_alphanumeric': 0.10768426555148981, 'fraction_numerical': 0.00836382645060115, 'mean_word_length': 3.645631067961165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '393530', 'n_tokens_mistral': 629, 'n_tokens_neox': 609, 'n_words': 110}