fastled 1.4.10__tar.gz → 1.4.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. {fastled-1.4.10 → fastled-1.4.12}/PKG-INFO +1 -1
  2. fastled-1.4.12/requirements.docker.txt +1 -0
  3. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/__version__.py +1 -1
  4. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/app.py +3 -0
  5. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/web_compile.py +54 -2
  6. {fastled-1.4.10 → fastled-1.4.12}/src/fastled.egg-info/PKG-INFO +1 -1
  7. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_manual_api_invocation.py +2 -45
  8. fastled-1.4.12/tests/unit/test_webcompile.py +81 -0
  9. fastled-1.4.10/requirements.docker.txt +0 -1
  10. fastled-1.4.10/tests/unit/test_webcompile.py +0 -43
  11. {fastled-1.4.10 → fastled-1.4.12}/.aiderignore +0 -0
  12. {fastled-1.4.10 → fastled-1.4.12}/.cursorrules +0 -0
  13. {fastled-1.4.10 → fastled-1.4.12}/.dockerignore +0 -0
  14. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/build_multi_docker_image.yml +0 -0
  15. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/build_webpage.yml +0 -0
  16. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/lint.yml +0 -0
  17. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/publish_release.yml +0 -0
  18. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/template_build_docker_image.yml +0 -0
  19. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/test_build_exe.yml +0 -0
  20. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/test_macos.yml +0 -0
  21. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/test_ubuntu.yml +0 -0
  22. {fastled-1.4.10 → fastled-1.4.12}/.github/workflows/test_win.yml +0 -0
  23. {fastled-1.4.10 → fastled-1.4.12}/.gitignore +0 -0
  24. {fastled-1.4.10 → fastled-1.4.12}/.pylintrc +0 -0
  25. {fastled-1.4.10 → fastled-1.4.12}/.vscode/launch.json +0 -0
  26. {fastled-1.4.10 → fastled-1.4.12}/.vscode/settings.json +0 -0
  27. {fastled-1.4.10 → fastled-1.4.12}/.vscode/tasks.json +0 -0
  28. {fastled-1.4.10 → fastled-1.4.12}/DEBUGGER.md +0 -0
  29. {fastled-1.4.10 → fastled-1.4.12}/Dockerfile +0 -0
  30. {fastled-1.4.10 → fastled-1.4.12}/FAQ.md +0 -0
  31. {fastled-1.4.10 → fastled-1.4.12}/LICENSE +0 -0
  32. {fastled-1.4.10 → fastled-1.4.12}/MANIFEST.in +0 -0
  33. {fastled-1.4.10 → fastled-1.4.12}/README.md +0 -0
  34. {fastled-1.4.10 → fastled-1.4.12}/RELEASE.md +0 -0
  35. {fastled-1.4.10 → fastled-1.4.12}/TODO.md +0 -0
  36. {fastled-1.4.10 → fastled-1.4.12}/build_exe.py +0 -0
  37. {fastled-1.4.10 → fastled-1.4.12}/build_local_docker.py +0 -0
  38. {fastled-1.4.10 → fastled-1.4.12}/build_site.py +0 -0
  39. {fastled-1.4.10 → fastled-1.4.12}/clean +0 -0
  40. {fastled-1.4.10 → fastled-1.4.12}/compiler/debug.sh +0 -0
  41. {fastled-1.4.10 → fastled-1.4.12}/compiler/run.py +0 -0
  42. {fastled-1.4.10 → fastled-1.4.12}/demo/100dots.html +0 -0
  43. {fastled-1.4.10 → fastled-1.4.12}/demo/demo_threejs.html +0 -0
  44. {fastled-1.4.10 → fastled-1.4.12}/demo/micdemo.html +0 -0
  45. {fastled-1.4.10 → fastled-1.4.12}/demo/mp3upload.html +0 -0
  46. {fastled-1.4.10 → fastled-1.4.12}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
  47. {fastled-1.4.10 → fastled-1.4.12}/docker-compose.yml +0 -0
  48. {fastled-1.4.10 → fastled-1.4.12}/entrypoint.sh +0 -0
  49. {fastled-1.4.10 → fastled-1.4.12}/install +0 -0
  50. {fastled-1.4.10 → fastled-1.4.12}/install_linux.sh +0 -0
  51. {fastled-1.4.10 → fastled-1.4.12}/lint +0 -0
  52. {fastled-1.4.10 → fastled-1.4.12}/pyproject.toml +0 -0
  53. {fastled-1.4.10 → fastled-1.4.12}/requirements.testing.txt +0 -0
  54. {fastled-1.4.10 → fastled-1.4.12}/setup.cfg +0 -0
  55. {fastled-1.4.10 → fastled-1.4.12}/setup.py +0 -0
  56. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/__init__.py +0 -0
  57. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/__main__.py +0 -0
  58. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/args.py +0 -0
  59. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/assets/example.txt +0 -0
  60. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/assets/localhost-key.pem +0 -0
  61. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/assets/localhost.pem +0 -0
  62. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/cli.py +0 -0
  63. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/cli_test.py +0 -0
  64. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/cli_test_interactive.py +0 -0
  65. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/client_server.py +0 -0
  66. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/compile_server.py +0 -0
  67. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/compile_server_impl.py +0 -0
  68. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/docker_manager.py +0 -0
  69. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/filewatcher.py +0 -0
  70. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/find_good_connection.py +0 -0
  71. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/interruptible_http.py +0 -0
  72. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/keyboard.py +0 -0
  73. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/keyz.py +0 -0
  74. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/live_client.py +0 -0
  75. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/open_browser.py +0 -0
  76. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/parse_args.py +0 -0
  77. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/paths.py +0 -0
  78. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/playwright/chrome_extension_downloader.py +0 -0
  79. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/playwright/playwright_browser.py +0 -0
  80. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/print_filter.py +0 -0
  81. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/project_init.py +0 -0
  82. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/select_sketch_directory.py +0 -0
  83. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/server_flask.py +0 -0
  84. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/server_start.py +0 -0
  85. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/settings.py +0 -0
  86. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/site/build.py +0 -0
  87. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/site/examples.py +0 -0
  88. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/sketch.py +0 -0
  89. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/spinner.py +0 -0
  90. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/string_diff.py +0 -0
  91. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  92. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/test/examples.py +0 -0
  93. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/types.py +0 -0
  94. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/util.py +0 -0
  95. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/version.py +0 -0
  96. {fastled-1.4.10 → fastled-1.4.12}/src/fastled/zip_files.py +0 -0
  97. {fastled-1.4.10 → fastled-1.4.12}/src/fastled.egg-info/SOURCES.txt +0 -0
  98. {fastled-1.4.10 → fastled-1.4.12}/src/fastled.egg-info/dependency_links.txt +0 -0
  99. {fastled-1.4.10 → fastled-1.4.12}/src/fastled.egg-info/entry_points.txt +0 -0
  100. {fastled-1.4.10 → fastled-1.4.12}/src/fastled.egg-info/requires.txt +0 -0
  101. {fastled-1.4.10 → fastled-1.4.12}/src/fastled.egg-info/top_level.txt +0 -0
  102. {fastled-1.4.10 → fastled-1.4.12}/test +0 -0
  103. {fastled-1.4.10 → fastled-1.4.12}/tests/integration/test_build_examples.py +0 -0
  104. {fastled-1.4.10 → fastled-1.4.12}/tests/integration/test_examples.py +0 -0
  105. {fastled-1.4.10 → fastled-1.4.12}/tests/integration/test_libcompile.py +0 -0
  106. {fastled-1.4.10 → fastled-1.4.12}/tests/integration/test_playwright_integration.py +0 -0
  107. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/html/index.html +0 -0
  108. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_api.py +0 -0
  109. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_bad_ino.py +0 -0
  110. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_banner_string.py +0 -0
  111. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_cli.py +0 -0
  112. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_cli_no_platformio.py +0 -0
  113. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_compile_server.py +0 -0
  114. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_debug_fetch_source_files.py +0 -0
  115. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_docker_linux_on_windows.py +0 -0
  116. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_embedded_data.py +0 -0
  117. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_filechanger.py +0 -0
  118. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_flask_headers.py +0 -0
  119. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_http_server.py +0 -0
  120. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_ino/bad/bad.ino +0 -0
  121. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  122. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
  123. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  124. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  125. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  126. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_no_platformio_compile.py +0 -0
  127. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_project_init.py +0 -0
  128. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_server_and_client_seperatly.py +0 -0
  129. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_session_compile.py +0 -0
  130. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_string_diff.py +0 -0
  131. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_string_diff_comprehensive.py +0 -0
  132. {fastled-1.4.10 → fastled-1.4.12}/tests/unit/test_version.py +0 -0
  133. {fastled-1.4.10 → fastled-1.4.12}/upload_package.sh +0 -0
  134. {fastled-1.4.10 → fastled-1.4.12}/vscode-plugin/readme +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.4.10
3
+ Version: 1.4.12
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -0,0 +1 @@
1
+ fastled-wasm-server>=1.1.21
@@ -1,6 +1,6 @@
1
1
  # IMPORTANT! There's a bug in github which will REJECT any version update
2
2
  # that has any other change in the repo. Please bump the version as the
3
3
  # ONLY change in a commit, or else the pypi update and the release will fail.
4
- __version__ = "1.4.10"
4
+ __version__ = "1.4.12"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
@@ -63,6 +63,9 @@ def main() -> int:
63
63
  # now it is safe to print out the version
64
64
  print(f"FastLED version: {__version__}")
65
65
 
66
+ # Print current working directory
67
+ print(f"Current working directory: {os.getcwd()}")
68
+
66
69
  # Check if Playwright browsers are installed
67
70
  playwright_dir = Path.home() / ".fastled" / "playwright"
68
71
  if playwright_dir.exists() and any(playwright_dir.iterdir()):
@@ -30,6 +30,38 @@ def _sanitize_host(host: str) -> str:
30
30
  return host if host.startswith("http://") else f"http://{host}"
31
31
 
32
32
 
33
+ def _check_embedded_http_status(response_content: bytes) -> tuple[bool, int | None]:
34
+ """
35
+ Check if the response content has an embedded HTTP status at the end.
36
+
37
+ Returns:
38
+ tuple: (has_embedded_status, status_code)
39
+ has_embedded_status is True if an embedded status was found
40
+ status_code is the embedded status code or None if not found
41
+ """
42
+ try:
43
+ # Convert bytes to string for parsing
44
+ content_str = response_content.decode("utf-8", errors="ignore")
45
+
46
+ # Look for HTTP_STATUS: at the end of the content
47
+ lines = content_str.strip().split("\n")
48
+ if lines:
49
+ last_line = lines[-1].strip()
50
+ if last_line.startswith("HTTP_STATUS:"):
51
+ # Extract the status code
52
+ try:
53
+ status_code = int(last_line.split(":", 1)[1].strip())
54
+ return True, status_code
55
+ except (ValueError, IndexError):
56
+ # Malformed status line
57
+ return True, None
58
+
59
+ return False, None
60
+ except Exception:
61
+ # If we can't parse the content, assume no embedded status
62
+ return False, None
63
+
64
+
33
65
  def _banner(msg: str) -> str:
34
66
  """
35
67
  Create a banner for the given message.
@@ -261,13 +293,33 @@ def web_compile(
261
293
  print("Step 1: Compiling libfastled...")
262
294
  try:
263
295
  libfastled_response = _compile_libfastled(host, auth_token, build_mode)
296
+
297
+ # Check HTTP response status first
264
298
  if libfastled_response.status_code != 200:
265
299
  print(
266
- f"Warning: libfastled compilation failed with status {libfastled_response.status_code}"
300
+ f"Warning: libfastled compilation failed with HTTP status {libfastled_response.status_code}"
267
301
  )
268
302
  # Continue with sketch compilation even if libfastled fails
269
303
  else:
270
- print("✅ libfastled compilation successful")
304
+ # Check for embedded HTTP status in response content
305
+ has_embedded_status, embedded_status = _check_embedded_http_status(
306
+ libfastled_response.content
307
+ )
308
+ if has_embedded_status:
309
+ if embedded_status is not None and embedded_status != 200:
310
+ print(
311
+ f"Warning: libfastled compilation failed with embedded status {embedded_status}"
312
+ )
313
+ # Continue with sketch compilation even if libfastled fails
314
+ elif embedded_status is None:
315
+ print(
316
+ "Warning: libfastled compilation returned malformed embedded status"
317
+ )
318
+ # Continue with sketch compilation even if libfastled fails
319
+ else:
320
+ print("✅ libfastled compilation successful")
321
+ else:
322
+ print("✅ libfastled compilation successful")
271
323
  except Exception as e:
272
324
  print(f"Warning: libfastled compilation failed: {e}")
273
325
  # Continue with sketch compilation even if libfastled fails
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.4.10
3
+ Version: 1.4.12
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -236,51 +236,8 @@ void loop() {
236
236
  if response.status_code != 200:
237
237
  print(f"❌ Response content: {response.text}")
238
238
 
239
- self.assertEqual(response.status_code, 200)
240
-
241
- # Verify we got some content back (streaming response)
242
- self.assertGreater(len(response.content), 0)
243
- print(f"📥 Response size: {len(response.content)} bytes")
244
-
245
- # Check if it's a zip file or other binary content
246
- if response.content.startswith(b"PK"): # ZIP file magic bytes
247
- print("📦 Response appears to be a ZIP file")
248
- # Try to extract and verify the response contains expected library files
249
- with tempfile.TemporaryDirectory() as temp_dir:
250
- temp_path = Path(temp_dir)
251
- zip_path = temp_path / "libfastled.zip"
252
- zip_path.write_bytes(response.content)
253
-
254
- # Extract and check contents
255
- import shutil
256
-
257
- shutil.unpack_archive(zip_path, temp_path, "zip")
258
-
259
- # Look for expected library files
260
- lib_files = list(temp_path.glob("**/*.a")) + list(
261
- temp_path.glob("**/*.so")
262
- )
263
- header_files = list(temp_path.glob("**/*.h")) + list(
264
- temp_path.glob("**/*.hpp")
265
- )
266
-
267
- print(f"🔍 Found library files: {[f.name for f in lib_files]}")
268
- print(f"🔍 Found header files: {[f.name for f in header_files]}")
269
-
270
- # We expect at least some library or header files
271
- self.assertGreater(
272
- len(lib_files) + len(header_files),
273
- 0,
274
- "Expected to find library or header files",
275
- )
276
- else:
277
- print("📄 Response appears to be text/binary data")
278
- # Could be a streaming response with compilation logs
279
- try:
280
- text_content = response.content.decode("utf-8")
281
- print(f"📝 Response preview: {text_content[:200]}...")
282
- except UnicodeDecodeError:
283
- print("🔧 Response contains binary data")
239
+ # We don't volume map so this should return 400
240
+ self.assertEqual(response.status_code, 400)
284
241
 
285
242
  @unittest.skipUnless(True, "Test manual API invocation")
286
243
  def test_project_init_endpoint_manual(self) -> None:
@@ -0,0 +1,81 @@
1
+ import time
2
+ import unittest
3
+ from pathlib import Path
4
+
5
+ from fastled.web_compile import _check_embedded_http_status, web_compile
6
+
7
+ HERE = Path(__file__).parent
8
+ TEST_DIR = HERE / "test_ino" / "wasm"
9
+
10
+ _USE_LOCALHOST = False
11
+ _HOST = "http://localhost" if _USE_LOCALHOST else None
12
+
13
+
14
+ class WebCompileTester(unittest.TestCase):
15
+ """Main tester class."""
16
+
17
+ def test_compile(self) -> None:
18
+ """Test web compilation functionality with real server."""
19
+ # Test the web_compile function with actual server call
20
+ start = time.time()
21
+ result = web_compile(TEST_DIR, host=_HOST)
22
+ diff = time.time() - start
23
+ print(f"Time taken: {diff:.2f} seconds")
24
+
25
+ # Verify we got a successful result
26
+ self.assertTrue(result.success, f"Compilation failed: {result.stdout}")
27
+
28
+ # Verify we got actual WASM data back
29
+ self.assertTrue(len(result.zip_bytes) > 0)
30
+
31
+ # Print compilation output for debugging
32
+ print(f"Compilation stdout:\n{result.stdout}")
33
+
34
+ print(f"Zip size: {len(result.zip_bytes)} bytes")
35
+
36
+ def test_invalid_directory(self) -> None:
37
+ """Test handling of invalid directory."""
38
+ with self.assertRaises(FileNotFoundError):
39
+ web_compile(Path("nonexistent_directory"))
40
+
41
+ def test_embedded_http_status_parsing(self) -> None:
42
+ """Test the _check_embedded_http_status function."""
43
+ # Test successful case (no embedded status)
44
+ content_success = b"Some output\nCompilation successful\n"
45
+ has_status, status_code = _check_embedded_http_status(content_success)
46
+ self.assertFalse(has_status)
47
+ self.assertIsNone(status_code)
48
+
49
+ # Test embedded 400 status
50
+ content_400 = b"Some error output\nHTTP_STATUS: 400"
51
+ has_status, status_code = _check_embedded_http_status(content_400)
52
+ self.assertTrue(has_status)
53
+ self.assertEqual(status_code, 400)
54
+
55
+ # Test embedded 200 status
56
+ content_200 = b"Some output\nHTTP_STATUS: 200"
57
+ has_status, status_code = _check_embedded_http_status(content_200)
58
+ self.assertTrue(has_status)
59
+ self.assertEqual(status_code, 200)
60
+
61
+ # Test malformed embedded status
62
+ content_malformed = b"Some output\nHTTP_STATUS: invalid"
63
+ has_status, status_code = _check_embedded_http_status(content_malformed)
64
+ self.assertTrue(has_status)
65
+ self.assertIsNone(status_code)
66
+
67
+ # Test empty content
68
+ content_empty = b""
69
+ has_status, status_code = _check_embedded_http_status(content_empty)
70
+ self.assertFalse(has_status)
71
+ self.assertIsNone(status_code)
72
+
73
+ # Test content with embedded status in middle (should not be detected)
74
+ content_middle = b"Some output\nHTTP_STATUS: 400\nMore output"
75
+ has_status, status_code = _check_embedded_http_status(content_middle)
76
+ self.assertFalse(has_status)
77
+ self.assertIsNone(status_code)
78
+
79
+
80
+ if __name__ == "__main__":
81
+ unittest.main()
@@ -1 +0,0 @@
1
- fastled-wasm-server>=1.1.18
@@ -1,43 +0,0 @@
1
- import time
2
- import unittest
3
- from pathlib import Path
4
-
5
- from fastled.web_compile import web_compile
6
-
7
- HERE = Path(__file__).parent
8
- TEST_DIR = HERE / "test_ino" / "wasm"
9
-
10
- _USE_LOCALHOST = False
11
- _HOST = "http://localhost" if _USE_LOCALHOST else None
12
-
13
-
14
- class WebCompileTester(unittest.TestCase):
15
- """Main tester class."""
16
-
17
- def test_compile(self) -> None:
18
- """Test web compilation functionality with real server."""
19
- # Test the web_compile function with actual server call
20
- start = time.time()
21
- result = web_compile(TEST_DIR, host=_HOST)
22
- diff = time.time() - start
23
- print(f"Time taken: {diff:.2f} seconds")
24
-
25
- # Verify we got a successful result
26
- self.assertTrue(result.success, f"Compilation failed: {result.stdout}")
27
-
28
- # Verify we got actual WASM data back
29
- self.assertTrue(len(result.zip_bytes) > 0)
30
-
31
- # Print compilation output for debugging
32
- print(f"Compilation stdout:\n{result.stdout}")
33
-
34
- print(f"Zip size: {len(result.zip_bytes)} bytes")
35
-
36
- def test_invalid_directory(self) -> None:
37
- """Test handling of invalid directory."""
38
- with self.assertRaises(FileNotFoundError):
39
- web_compile(Path("nonexistent_directory"))
40
-
41
-
42
- if __name__ == "__main__":
43
- unittest.main()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes