# -*- coding: utf-8 -*-

from __future__ import (absolute_import, division,
                        print_function)

import numpy as np

from ..read_config import read_config
import os


class TestConfig(object):
    @classmethod
    def setup_class(cls):
        cls.curdir = os.path.abspath(os.path.dirname(__file__))
        cls.datadir = os.path.join(cls.curdir, 'data')

    def test_read_config(self):
        """Test that config file are read."""

        fname = os.path.join(self.datadir, 'test_config.ini')

        config = read_config(fname)

        np.testing.assert_almost_equal(config['pixel_size'],
                                       np.radians(0.5 / 60))
        assert config['interpolation'] == 'spline'

    def test_read_incomplete_config(self):
        """Test that config file are read."""
        fname = os.path.join(self.datadir, 'test_config_incomplete.ini')

        config = read_config(fname)

        np.testing.assert_almost_equal(config['pixel_size'],
                                       np.radians(1 / 60))
        assert config['interpolation'] == 'linear'


@@ -178,16 +178,42 @@
 port os%0A
+import astropy.units as u%0A
 %0A%0Aclass 
@@ -625,32 +625,48 @@
 ig%5B'pixel_size'%5D
+.to(u.rad).value
 ,%0A              
@@ -956,32 +956,32 @@
 _config(fname)%0A%0A
-
         np.testi
@@ -1023,16 +1023,32 @@
 l_size'%5D
+.to(u.rad).value
 ,%0A      

Fix test after units