|
| 1 | +#!/usr/bin/env python3 |
| 2 | +import sys |
| 3 | +sys.path.append('.') |
| 4 | + |
| 5 | +def test_constants_import(): |
| 6 | + try: |
| 7 | + from pcweb.constants import ( |
| 8 | + MAX_FILE_SIZE_MB, MAX_IMAGES_COUNT, PROMPT_MAP, |
| 9 | + CONTRIBUTION_URL, BUGS_URL, FONT_FAMILY, DOC_BORDER_RADIUS, |
| 10 | + SPLINE_SCENE_URL, REFLEX_DOMAIN_URL, TWITTER_CREATOR, PRICING_TABLE_STYLES |
| 11 | + ) |
| 12 | + print('✓ All new constants imported successfully') |
| 13 | + print(f'MAX_FILE_SIZE_MB: {MAX_FILE_SIZE_MB}') |
| 14 | + print(f'PROMPT_MAP keys: {list(PROMPT_MAP.keys())}') |
| 15 | + print(f'FONT_FAMILY: {FONT_FAMILY}') |
| 16 | + print(f'PRICING_TABLE_STYLES keys: {list(PRICING_TABLE_STYLES.keys())}') |
| 17 | + return True |
| 18 | + except ImportError as e: |
| 19 | + print(f'✗ Import error: {e}') |
| 20 | + return False |
| 21 | + |
| 22 | +def test_updated_imports(): |
| 23 | + try: |
| 24 | + from pcweb.pages.landing.views.hero import SubmitPromptState |
| 25 | + from pcweb.pages.framework.views.open_source import open_source |
| 26 | + from pcweb.styles.styles import SANS |
| 27 | + from pcweb.styles.fonts import font_family |
| 28 | + from pcweb.pages.pricing.table import STYLES |
| 29 | + from pcweb.components.spline import Spline |
| 30 | + from pcweb.meta.meta import meta_tags |
| 31 | + print('✓ All updated imports work correctly') |
| 32 | + return True |
| 33 | + except ImportError as e: |
| 34 | + print(f'✗ Import error in updated files: {e}') |
| 35 | + return False |
| 36 | + |
| 37 | +if __name__ == "__main__": |
| 38 | + success = test_constants_import() and test_updated_imports() |
| 39 | + sys.exit(0 if success else 1) |
0 commit comments