import unittest, os
import numpy.testing as testing
import numpy as np

import redmapper

class ReadConfigTestCase(unittest.TestCase):
    
    def runTest(self):
        """
        All we can test from the config file are that the fields are what we
        expect them to be.
        """
        file_name = 'testconfig.yaml'
        file_path = 'data_for_tests'

        confdict = redmapper.config.Configuration('%s/%s' % (file_path, file_name))

        self.assertEqual(confdict.galfile,'./data_for_tests/pixelized_dr8_test/dr8_test_galaxies_master_table.fit')
        self.assertEqual(confdict.specfile,'./data_for_tests/dr8_test_spec.fit')
        self.assertEqual(confdict.parfile,'./data_for_tests/test_dr8_pars.fit')
        self.assertEqual(confdict.bkgfile,'./data_for_tests/dr8_bkg.fit')
        self.assertEqual(confdict.zrange,[0.05,0.60])
        self.assertEqual(confdict.outbase,"dr8_testing")
        self.assertEqual(confdict.chisq_max,20.0)
        self.assertEqual(confdict.lval_reference,0.2)
        self.assertEqual(confdict.mask_mode,0)
        self.assertEqual(confdict.nmag,5)
        testing.assert_almost_equal(confdict.area, 3.3571745808326572)
        testing.assert_almost_equal(confdict.b[0], 1.39999998e-10)
        self.assertEqual(confdict.b.size, confdict.nmag)
        testing.assert_almost_equal(confdict.zeropoint,22.5)
        self.assertEqual(confdict.ref_ind,3)
        # all other values in the confdict are None

if __name__=='__main__':
    unittest.main()

@@ -128,20 +128,16 @@
 tCase):%0A
-    
 %0A    def
@@ -368,20 +368,18 @@
     conf
-dict
+ig
  = redma
@@ -389,16 +389,23 @@
 r.config
+uration
 .Configu
@@ -475,20 +475,18 @@
 ual(conf
-dict
+ig
 .galfile
@@ -589,20 +589,18 @@
 ual(conf
-dict
+ig
 .specfil
@@ -668,20 +668,18 @@
 ual(conf
-dict
+ig
 .parfile
@@ -746,20 +746,18 @@
 ual(conf
-dict
+ig
 .bkgfile
@@ -775,19 +775,20 @@
 r_tests/
-dr8
+test
 _bkg.fit
@@ -819,20 +819,18 @@
 ual(conf
-dict
+ig
 .zrange,
@@ -871,20 +871,18 @@
 ual(conf
-dict
+ig
 .outbase
@@ -926,20 +926,18 @@
 ual(conf
-dict
+ig
 .chisq_m
@@ -974,20 +974,18 @@
 ual(conf
-dict
+ig
 .lval_re
@@ -1026,20 +1026,18 @@
 ual(conf
-dict
+ig
 .mask_mo
@@ -1039,17 +1039,17 @@
 sk_mode,
-0
+3
 )%0A      
@@ -1067,28 +1067,26 @@
 rtEqual(conf
-dict
+ig
 .nmag,5)%0A   
@@ -1122,20 +1122,18 @@
 ual(conf
-dict
+ig
 .area, 3
@@ -1191,20 +1191,18 @@
 ual(conf
-dict
+ig
 .b%5B0%5D, 1
@@ -1245,20 +1245,18 @@
 ual(conf
-dict
+ig
 .b.size,
@@ -1260,20 +1260,18 @@
 ze, conf
-dict
+ig
 .nmag)%0A 
@@ -1309,20 +1309,18 @@
 ual(conf
-dict
+ig
 .zeropoi
@@ -1357,20 +1357,18 @@
 ual(conf
-dict
+ig
 .ref_ind
@@ -1413,12 +1413,10 @@
 conf
-dict
+ig
  are

Clean up.