File tree 1 file changed +35
-0
lines changed 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -962,4 +962,39 @@ TEST_SUITE("xassist"){
962
962
std::remove (" openai_api_key.txt" );
963
963
}
964
964
965
+ TEST_CASE (" ollama" ){
966
+ xcpp::xassist assist;
967
+ std::string line = " %%xassist ollama --set-url" ;
968
+ std::string cell = " 1234" ;
969
+
970
+ assist (line, cell);
971
+
972
+ std::ifstream infile (" ollama_url.txt" );
973
+ std::string content;
974
+ std::getline (infile, content);
975
+
976
+ REQUIRE (content == " 1234" );
977
+ infile.close ();
978
+
979
+ line = " %%xassist ollama --save-model" ;
980
+ cell = " 1234" ;
981
+
982
+ assist (line, cell);
983
+
984
+ std::ifstream infile_model (" ollama_model.txt" );
985
+ std::string content_model;
986
+ std::getline (infile_model, content_model);
987
+
988
+ REQUIRE (content_model == " 1234" );
989
+ infile_model.close ();
990
+
991
+ StreamRedirectRAII redirect (std::cerr);
992
+
993
+ assist (" %%xassist openai" , " hello" );
994
+
995
+ REQUIRE (!redirect.getCaptured ().empty ());
996
+
997
+ std::remove (" openai_api_key.txt" );
998
+ }
999
+
965
1000
}
You can’t perform that action at this time.
0 commit comments