import unittest
import figgypy.config

import sys
import os

class TestConfig(unittest.TestCase):
    def test_config_load(self):
        os.environ['FIGGY_GPG_HOME']='tests/resources/test-keys'
        c = figgypy.config.Config('tests/resources/test-config.yaml')
        self.assertEqual(c.db, 'db.heck.ya')
        self.assertEqual(c.secrets['hush_hush'], 'i-u-i')


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

import unittest
import figgypy.config

import sys
import os

class TestConfig(unittest.TestCase):
    def test_config_load(self):
        os.environ['FIGGY_GPG_HOME']='tests/resources/test-keys'
        c = figgypy.config.Config('tests/resources/test-config.yaml')
        self.assertEqual(c.db['host'], 'db.heck.ya')
        self.assertEqual(c.db['pass'], 'test password')


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

Modify to test with nesting
Modify to test with nesting

  import unittest
  import figgypy.config
  
  import sys
  import os
  
  class TestConfig(unittest.TestCase):
      def test_config_load(self):
          os.environ['FIGGY_GPG_HOME']='tests/resources/test-keys'
          c = figgypy.config.Config('tests/resources/test-config.yaml')
-         self.assertEqual(c.db, 'db.heck.ya')
+         self.assertEqual(c.db['host'], 'db.heck.ya')
-         self.assertEqual(c.secrets['hush_hush'], 'i-u-i')
+         self.assertEqual(c.db['pass'], 'test password')
  
  
  if __name__ == '__main__':
      unittest.main()
  
Modify to test with nesting
## Code Before:
import unittest
import figgypy.config

import sys
import os

class TestConfig(unittest.TestCase):
    def test_config_load(self):
        os.environ['FIGGY_GPG_HOME']='tests/resources/test-keys'
        c = figgypy.config.Config('tests/resources/test-config.yaml')
        self.assertEqual(c.db, 'db.heck.ya')
        self.assertEqual(c.secrets['hush_hush'], 'i-u-i')


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

## Instruction:
Modify to test with nesting
## Code After:
import unittest
import figgypy.config

import sys
import os

class TestConfig(unittest.TestCase):
    def test_config_load(self):
        os.environ['FIGGY_GPG_HOME']='tests/resources/test-keys'
        c = figgypy.config.Config('tests/resources/test-config.yaml')
        self.assertEqual(c.db['host'], 'db.heck.ya')
        self.assertEqual(c.db['pass'], 'test password')


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