renamed hf-embed -> help

This commit is contained in:
Paul Gauthier 2024-07-16 10:58:49 +01:00
parent bd8143a880
commit b18dbf4772
8 changed files with 23 additions and 22 deletions

View file

@ -1,31 +1,31 @@
import unittest
from unittest.mock import patch
import sys
import os
# Add the parent directory to the Python path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from aider.main import main
class TestBrowser(unittest.TestCase):
@patch('aider.main.launch_gui')
@patch("aider.main.launch_gui")
def test_browser_flag_imports_streamlit(self, mock_launch_gui):
# Run main with --browser and --yes flags
main(['--browser', '--yes'])
main(["--browser", "--yes"])
# Check that launch_gui was called
mock_launch_gui.assert_called_once()
# Try to import streamlit
try:
import streamlit
import streamlit # noqa: F401
streamlit_imported = True
except ImportError:
streamlit_imported = False
# Assert that streamlit was successfully imported
self.assertTrue(streamlit_imported, "Streamlit should be importable after running with --browser flag")
if __name__ == '__main__':
# Assert that streamlit was successfully imported
self.assertTrue(
streamlit_imported, "Streamlit should be importable after running with --browser flag"
)
if __name__ == "__main__":
unittest.main()