mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Test: verify file webhost file creations work to some degree (#953)
WebHost: fix some file creation paths
This commit is contained in:
23
test/webhost/TestFileGeneration.py
Normal file
23
test/webhost/TestFileGeneration.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Tests for successful generation of WebHost cached files. Can catch some other deeper errors."""
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import WebHost
|
||||
|
||||
|
||||
class TestFileGeneration(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
self.correct_path = os.path.join(os.path.dirname(WebHost.__file__), "WebHostLib")
|
||||
# should not create the folder *here*
|
||||
self.incorrect_path = os.path.join(os.path.split(os.path.dirname(__file__))[0], "WebHostLib")
|
||||
|
||||
def testOptions(self):
|
||||
WebHost.create_options_files()
|
||||
self.assertTrue(os.path.exists(os.path.join(self.correct_path, "static", "generated", "configs")))
|
||||
self.assertFalse(os.path.exists(os.path.join(self.incorrect_path, "static", "generated", "configs")))
|
||||
|
||||
def testTutorial(self):
|
||||
WebHost.create_ordered_tutorials_file()
|
||||
self.assertTrue(os.path.exists(os.path.join(self.correct_path, "static", "generated", "tutorials.json")))
|
||||
self.assertFalse(os.path.exists(os.path.join(self.incorrect_path, "static", "generated", "tutorials.json")))
|
Reference in New Issue
Block a user