Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-buckmaster committed Jan 19, 2025
1 parent a48ca2b commit 555349e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/models/language_model_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LanguageModelTest < ActiveSupport::TestCase

test "effective_api_name fails with message when api_name ends in best" do
language_models(:gpt_4o).update!(best: false)
exc = assert_raises do
exc = assert_raises do
language_models(:gpt_best).effective_api_name
end
assert_equal "Could not resolve best model for gpt-best from API service OpenAI", exc.to_s
Expand Down
2 changes: 1 addition & 1 deletion test/models/run_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RunTest < ActiveSupport::TestCase

test "effective model populated from conversations language_model" do
assistant = assistants(:keith_claude3)
assistant.language_model.stub :effective_api_name, 'test-effective' do
assistant.language_model.stub :effective_api_name, "test-effective" do
r = Run.create!(
assistant: assistant,
conversation: conversations(:greeting),
Expand Down
4 changes: 2 additions & 2 deletions test/services/ai_backend/anthropic_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class AIBackend::AnthropicTest < ActiveSupport::TestCase
end

test "client uses effective api name for language model" do
@assistant.language_model.stub :effective_api_name, 'test-effective' do
@assistant.language_model.stub :effective_api_name, "test-effective" do
@anthropic = AIBackend::Anthropic.new(
users(:keith),
@assistant,
@conversation,
@conversation.latest_message_for_version(:latest)
)
@anthropic.send(:set_client_config,{})
assert_equal 'test-effective', @anthropic.instance_eval('@client_config')[:model]
assert_equal "test-effective", @anthropic.instance_eval("@client_config")[:model]
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/services/ai_backend/gemini_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class AIBackend::GeminiTest < ActiveSupport::TestCase
end

test "client uses effective api name for language model" do
@assistant.language_model.stub :effective_api_name, 'test-effective' do
@assistant.language_model.stub :effective_api_name, "test-effective" do
@gemini = AIBackend::Gemini.new(
users(:keith),
@assistant,
@conversation,
@conversation.latest_message_for_version(:latest)
)
assert_equal 'test-effective', @gemini.client.init_args[:options][:model]
assert_equal "test-effective", @gemini.client.init_args[:options][:model]
end
end
end
8 changes: 4 additions & 4 deletions test/services/ai_backend/open_ai_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class AIBackend::OpenAITest < ActiveSupport::TestCase
end

test "client uses effective api name for language model" do
@openai.stub :system_message, 'test-system-message' do # Not sure how not to stub this one
@assistant.language_model.stub :effective_api_name, 'test-effective' do
@openai.send(:set_client_config,{messages: 'test-msg'})
assert_equal 'test-effective', @openai.instance_eval('@client_config')[:parameters][:model]
@openai.stub :system_message, "test-system-message" do # Not sure how not to stub this one
@assistant.language_model.stub :effective_api_name, "test-effective" do
@openai.send(:set_client_config, {messages: "test-msg"})
assert_equal "test-effective", @openai.instance_eval("@client_config")[:parameters][:model]
end
end
end
Expand Down

0 comments on commit 555349e

Please sign in to comment.