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

8from fundamentals import tools 

9from os.path import expanduser 

10home = expanduser("~") 

11 

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

13settingsFile = packageDirectory + "/test_settings.yaml" 

14 

15su = tools( 

16 arguments={"settingsFile": settingsFile}, 

17 docString=__doc__, 

18 logLevel="DEBUG", 

19 options_first=False, 

20 projectName=None, 

21 defaultSettingsFile=False 

22) 

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

24 

25# SETUP PATHS TO COMMON DIRECTORIES FOR TEST DATA 

26moduleDirectory = os.path.dirname(__file__) 

27pathToInputDir = moduleDirectory + "/input/" 

28pathToOutputDir = moduleDirectory + "/output/" 

29 

30try: 

31 shutil.rmtree(pathToOutputDir) 

32except: 

33 pass 

34# COPY INPUT TO OUTPUT DIR 

35shutil.copytree(pathToInputDir, pathToOutputDir) 

36 

37# Recursively create missing directories 

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

39 os.makedirs(pathToOutputDir) 

40 

41 

42class test_sdss_square_search(unittest.TestCase): 

43 

44 def test_sdss_square_search_function_01(self): 

45 from sloancone import sdss_square_search 

46 kwargs = {} 

47 kwargs["log"] = log 

48 kwargs["ra"] = 179.5 

49 kwargs["dec"] = -1.0 

50 kwargs["searchRadius"] = 10.0 

51 # xt-kwarg_key_and_value 

52 

53 search = sdss_square_search(**kwargs) 

54 search.get() 

55 

56 def test_sdss_square_search_function_02(self): 

57 from sloancone import sdss_square_search 

58 kwargs = {} 

59 kwargs["log"] = log 

60 kwargs["ra"] = "23:23:13.23234" 

61 kwargs["dec"] = "-01:00:00.22323" 

62 kwargs["searchRadius"] = 170.0 

63 # xt-kwarg_key_and_value 

64 

65 search = sdss_square_search(**kwargs) 

66 search.get() 

67 

68 # x-print-testpage-for-pessto-marshall-web-object 

69 

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