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 sherlock.utKit import utKit 

8from fundamentals import tools 

9from os.path import expanduser 

10from docopt import docopt 

11from sherlock import cl_utils 

12doc = cl_utils.__doc__ 

13home = expanduser("~") 

14 

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

16settingsFile = packageDirectory + "/test_settings.yaml" 

17 

18su = tools( 

19 arguments={"settingsFile": settingsFile}, 

20 docString=__doc__, 

21 logLevel="DEBUG", 

22 options_first=False, 

23 projectName=None, 

24 defaultSettingsFile=False 

25) 

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

27 

28# SETUP PATHS TO COMMON DIRECTORIES FOR TEST DATA 

29moduleDirectory = os.path.dirname(__file__) 

30pathToInputDir = moduleDirectory + "/input/" 

31pathToOutputDir = moduleDirectory + "/output/" 

32 

33try: 

34 shutil.rmtree(pathToOutputDir) 

35except: 

36 pass 

37# COPY INPUT TO OUTPUT DIR 

38shutil.copytree(pathToInputDir, pathToOutputDir) 

39 

40# Recursively create missing directories 

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

42 os.makedirs(pathToOutputDir) 

43 

44 

45class test_cl_utils(unittest.TestCase): 

46 

47 def test_init(self): 

48 # TEST CL-OPTIONS 

49 command = "sherlock init" 

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

51 cl_utils.main(args) 

52 return 

53 

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