Hide keyboard shortcuts

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 docopt import docopt 

8from frankenstein import cl_utils 

9doc = cl_utils.__doc__ 

10from frankenstein.utKit import utKit 

11from fundamentals import tools 

12from os.path import expanduser 

13home = expanduser("~") 

14 

15packageDirectory = utKit("").get_project_root() 

16settingsFile = packageDirectory + "/test_settings.yaml" 

17# settingsFile = home + "/git_repos/_misc_/settings/frankensteinyy/test_settings.yaml" 

18 

19su = tools( 

20 arguments={"settingsFile": settingsFile}, 

21 docString=__doc__, 

22 logLevel="DEBUG", 

23 options_first=False, 

24 projectName=None, 

25 defaultSettingsFile=False 

26) 

27arguments, settings, log, dbConn = su.setup() 

28 

29# SETUP PATHS TO COMMON DIRECTORIES FOR TEST DATA 

30moduleDirectory = os.path.dirname(__file__) 

31pathToInputDir = moduleDirectory + "/input/" 

32pathToOutputDir = moduleDirectory + "/output/" 

33 

34try: 

35 shutil.rmtree(pathToOutputDir) 

36except: 

37 pass 

38# COPY INPUT TO OUTPUT DIR 

39shutil.copytree(pathToInputDir, pathToOutputDir) 

40 

41# Recursively create missing directories 

42if not os.path.exists(pathToOutputDir): 

43 os.makedirs(pathToOutputDir) 

44 

45class test_cl_utils(unittest.TestCase): 

46 

47 def test_init(self): 

48 # TEST CL-OPTIONS 

49 command = "frankenstein init" 

50 args = docopt(doc, command.split(" ")[1:]) 

51 cl_utils.main(args) 

52 return 

53 

54 # x-class-to-test-named-worker-function