mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-24 23:58:15 +00:00
Add PyInstaller compatibility support (fixes #2613)
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
16
tests/test_pyinstaller_compat.py
Normal file
16
tests/test_pyinstaller_compat.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
import sys
|
||||
|
||||
from crewai.utilities.pyinstaller_compat import is_bundled, get_bundle_dir
|
||||
|
||||
|
||||
class TestPyInstallerCompat(unittest.TestCase):
|
||||
def test_is_bundled_normal(self):
|
||||
self.assertFalse(is_bundled())
|
||||
|
||||
@patch.object(sys, 'frozen', True, create=True)
|
||||
@patch.object(sys, '_MEIPASS', '/path/to/bundle', create=True)
|
||||
def test_is_bundled_pyinstaller(self):
|
||||
self.assertTrue(is_bundled())
|
||||
self.assertEqual(get_bundle_dir(), '/path/to/bundle')
|
||||
Reference in New Issue
Block a user