Coverage for soxspipe/tests/test_cl_utils.py: 0%

# Coverage for soxspipe/tests/test_cl_utils.py : 0%

## 33 statements 0 run 33 missing 0 excluded

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

1 from __future__ import print_function

2 from builtins import str

3 import os

4 import unittest

5 import shutil

6 import yaml

7 from soxspipe.utKit import utKit

8 from fundamentals import tools

9 from os.path import expanduser

10 from docopt import docopt

11 from soxspipe import cl_utils

12 doc = cl_utils.__doc__

13 home = expanduser("~")

14

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

16 settingsFile = packageDirectory + "/test_settings.yaml"

17

18 su = tools(

19 arguments={"settingsFile": settingsFile},

20 docString=__doc__,

21 logLevel="DEBUG",

22 options_first=False,

23 projectName=None,

24 defaultSettingsFile=False

25)

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

27

28# SETUP PATHS TO COMMON DIRECTORIES FOR TEST DATA

29 moduleDirectory = os.path.dirname(__file__)

30 pathToInputDir = moduleDirectory + "/input/"

31 pathToOutputDir = moduleDirectory + "/output/"

32

33 try:

34 shutil.rmtree(pathToOutputDir)

35 except:

36 pass

37# COPY INPUT TO OUTPUT DIR

38 shutil.copytree(pathToInputDir, pathToOutputDir)

39

40# Recursively create missing directories

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

42 os.makedirs(pathToOutputDir)

43

44

45 class test_cl_utils(unittest.TestCase):

46

47 def test_init(self):

48 # TEST CL-OPTIONS

49 command = "soxspipe init"

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

51 cl_utils.main(args)

52 return

53

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