Coverage for frankenstein/tests/test_electric.py : 93%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from __future__ import print_function
2from builtins import str
3import os
4import unittest
5import shutil
6import yaml
7from frankenstein.utKit import utKit
8from fundamentals import tools
9from os.path import expanduser
10home = expanduser("~")
12packageDirectory = utKit("").get_project_root()
13settingsFile = packageDirectory + "/test_settings.yaml"
14# settingsFile = home + "/git_repos/_misc_/settings/frankensteinyy/test_settings.yaml"
16su = tools(
17 arguments={"settingsFile": settingsFile},
18 docString=__doc__,
19 logLevel="DEBUG",
20 options_first=False,
21 projectName=None,
22 defaultSettingsFile=False
23)
24arguments, settings, log, dbConn = su.setup()
26# SETUP PATHS TO COMMON DIRECTORIES FOR TEST DATA
27moduleDirectory = os.path.dirname(__file__)
28pathToInputDir = moduleDirectory + "/input/"
29pathToOutputDir = moduleDirectory + "/output/"
31try:
32 shutil.rmtree(pathToOutputDir)
33except:
34 pass
35# COPY INPUT TO OUTPUT DIR
36shutil.copytree(pathToInputDir, pathToOutputDir)
38# Recursively create missing directories
39if not os.path.exists(pathToOutputDir):
40 os.makedirs(pathToOutputDir)
42pathToTemplate = pathToInputDir + "/test_template"
43pathToDestination = pathToOutputDir
45class test_electric(unittest.TestCase):
47 def test_electric_function(self):
48 from frankenstein import electric
49 kwargs = {}
50 kwargs["log"] = log
51 kwargs["settings"] = settings
52 kwargs["pathToTemplate"] = pathToTemplate
53 kwargs["pathToDestination"] = pathToDestination
54 # xt-kwarg_key_and_value
55 testObject = electric(**kwargs)
56 testObject.get()
58 def test_electric_list_function(self):
59 from frankenstein import electric
60 kwargs = {}
61 kwargs["log"] = log
62 kwargs["settings"] = settings
63 kwargs["pathToTemplate"] = pathToTemplate
64 kwargs["pathToDestination"] = pathToDestination
65 # xt-kwarg_key_and_value
66 testObject = electric(**kwargs)
67 testObject.list_placeholders()
69 # x-print-testpage-for-pessto-marshall-web-object
71 # x-class-to-test-named-worker-function