mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 22:04:59 +00:00
renamed hf-embed -> help
This commit is contained in:
parent
bd8143a880
commit
b18dbf4772
8 changed files with 23 additions and 22 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue