diff tests/basefs.py @ 674:f987b29d6fab

tests: Add ability to run tests with a theme site. * Remove automatic creating of `config.yml`. * Add option to specify `theme_config` in YAML tests.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 06 Mar 2016 23:48:01 -0800
parents 152a15046b41
children 72f17534d58e
line wrap: on
line diff
--- a/tests/basefs.py	Sun Mar 06 23:41:35 2016 -0800
+++ b/tests/basefs.py	Sun Mar 06 23:48:01 2016 -0800
@@ -7,12 +7,6 @@
     def __init__(self):
         pass
 
-    def _initDefaultSpec(self):
-        self.withDir('counter')
-        self.withFile(
-                'kitchen/config.yml',
-                "site:\n  title: Mock Website\n")
-
     def path(self, p):
         raise NotImplementedError()
 
@@ -28,9 +22,10 @@
     def _createFile(self, path, contents):
         raise NotImplementedError()
 
-    def getApp(self, cache=True):
+    def getApp(self, *, cache=True, theme_site=False):
         root_dir = self.path('/kitchen')
-        return PieCrust(root_dir, cache=cache, debug=True)
+        return PieCrust(root_dir, cache=cache, debug=True,
+                        theme_site=theme_site)
 
     def withDir(self, path):
         path = self.path(path)
@@ -48,14 +43,16 @@
     def withAssetDir(self, path):
         return self.withDir('kitchen/' + path)
 
-    def withConfig(self, config):
+    def withConfig(self, config=None):
+        if config is None:
+            config = {}
         return self.withFile(
                 'kitchen/config.yml',
                 yaml.dump(config))
 
     def withThemeConfig(self, config):
         return self.withFile(
-                'kitchen/theme/theme_config.yml',
+                'kitchen/theme_config.yml',
                 yaml.dump(config))
 
     def withPage(self, url, config=None, contents=None):