""" Test 8: Simple Module Import Test Purpose: Test if very basic module imports work in Container Runtime Based on successful hello world foundation """ import streamlit as st # Page configuration st.set_page_config( page_title="Spark POC - Simple Import Test", page_icon="📦", layout="wide" ) st.title("📦 Test 8: Simple Module Import") st.write("Testing basic module imports in Container Runtime (based on working hello world)") # ============================================================================= # BASIC FUNCTIONALITY TEST # ============================================================================= st.header("🎉 Basic App Status") st.success("✅ Basic Streamlit app is working!") # ============================================================================= # SIMPLE IMPORT TEST # ============================================================================= st.header("📦 Module Import Test") if st.button("Test Module Import"): try: # Attempt to import our simple utility module import simple_utils st.success("✅ Module import successful!") # Test the functions greeting = simple_utils.say_hello("Container Runtime") st.write(f"**Greeting:** {greeting}") result = simple_utils.add_two_numbers(10, 15) st.write(f"**Calculation:** 10 + 15 = {result}") status = simple_utils.get_status() st.write(f"**Status:** {status}") st.balloons() st.success("🎉 All module functions work perfectly!") except ImportError as e: st.error(f"❌ Import failed: {str(e)}") st.write("**Details:** Module import is not working in Container Runtime") except Exception as e: st.error(f"❌ Unexpected error: {str(e)}") st.write("**Details:** Module imported but function execution failed") # ============================================================================= # FALLBACK FUNCTIONALITY # ============================================================================= st.header("🔄 Fallback Test") if st.button("Test Without Import"): # Test the same functionality without imports (inline) def inline_hello(name="World"): return f"Hello, {name}!" def inline_add(a, b): return a + b greeting = inline_hello("Inline Function") result = inline_add(10, 15) st.success("✅ Inline functions work!") st.write(f"**Greeting:** {greeting}") st.write(f"**Calculation:** 10 + 15 = {result}") # ============================================================================= # RESULTS SUMMARY # ============================================================================= st.header("📊 Test Results") st.info(""" **This test will determine:** ✅ **If Import Works:** - Container Runtime supports modular architecture - We can organize code into separate files - Ready for more complex POC development ❌ **If Import Fails:** - Container Runtime requires single-file architecture (as suspected from Phase 0) - Must use class-based organization within one file - Proceed with single-file POC approach **Either way, we have a clear path forward for POC development!** """) st.write("---") st.caption("Simple import test - definitive answer on Container Runtime module support 📦")