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

import sys
import unittest

sys.path.append('./')

from lazyconfig import lazyconfig, LazyConfig


class TestLazyConfig(unittest.TestCase):

    def setUp(self):
        LazyConfig.yaml_file = None
        LazyConfig.loaded = False

    def test_custom_filename(self):
        self.assertIsNone(LazyConfig.yaml_file)
        self.assertFalse(LazyConfig.loaded)
        lazyconfig.set_config_file('tests/data/example.yaml')
        lazyconfig.load()
        self.assertIsNotNone(lazyconfig.config)
        self.assertEquals(LazyConfig.yaml_file, 'tests/data/example.yaml')
        self.assertTrue(LazyConfig.loaded)

    def test_custom_filename_class(self):
        self.assertIsNone(LazyConfig.yaml_file)
        self.assertFalse(LazyConfig.loaded)
        LazyConfig.set_config_file('tests/data/example.yaml')
        lazyconfig.load()
        self.assertIsNotNone(lazyconfig.config)
        self.assertEquals(LazyConfig.yaml_file, 'tests/data/example.yaml')
        self.assertTrue(LazyConfig.loaded)

    def test_default_filename(self):
        self.assertEquals(lazyconfig.config.foo.bar, 'test')
        self.assertIsNotNone(lazyconfig.yaml_file)
        self.assertTrue(lazyconfig.yaml_file.endswith('config.yaml'))
        self.assertTrue(lazyconfig.loaded)


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

@@ -298,38 +298,38 @@
      self.assert
-IsNone
+Equals
 (LazyConfig.yaml
@@ -325,32 +325,38 @@
 Config.yaml_file
+, None
 )%0A        self.a
@@ -488,32 +488,27 @@
  self.assert
-IsNotNon
+Tru
 e(lazyconfig
@@ -506,32 +506,44 @@
 azyconfig.config
+ is not None
 )%0A        self.a
@@ -712,14 +712,14 @@
 sert
-IsNone
+Equals
 (Laz
@@ -727,32 +727,38 @@
 Config.yaml_file
+, None
 )%0A        self.a
@@ -890,32 +890,27 @@
  self.assert
-IsNotNon
+Tru
 e(lazyconfig
@@ -916,16 +916,28 @@
 g.config
+ is not None
 )%0A      
@@ -1170,16 +1170,11 @@
 sert
-IsNotNon
+Tru
 e(la
@@ -1191,16 +1191,28 @@
 aml_file
+ is not None
 )%0A      

Fix Python 2.6 tests.