예제 #1
0
 def test_set_config_option_unset_section(self):
     """Check set throws AttributeError as required section for settings
     option is not defined yet"""
     db = AccessionID(config=os.path.join(self.testdir, 'taxadb.cfg'))
     with self.assertRaises(AttributeError):
         db.set('newoption', 'newvalue', section="UNSET_SECCTION")
예제 #2
0
 def test_set_config_option_unset_section(self):
     """Check set throws AttributeError as required section for settings
     option is not defined yet"""
     db = AccessionID(config=os.path.join(self.testdir, 'taxadb.cfg'))
     with self.assertRaises(AttributeError):
         db.set('newoption', 'newvalue', section="UNSET_SECCTION")
예제 #3
0
 def test_get_config_returnsNone(self):
     """Check get method returns None when an option has no value in
     configuration file"""
     db = AccessionID(config=os.path.join(self.testdir, 'taxadb.cfg'))
     db.set('foobar', None)
     self.assertIsNone(db.get('foobar'))
예제 #4
0
 def test_get_config_returnsNone(self):
     """Check get method returns None when an option has no value in
     configuration file"""
     db = AccessionID(config=os.path.join(self.testdir, 'taxadb.cfg'))
     db.set('foobar', None)
     self.assertIsNone(db.get('foobar'))