def test_find_file(self): for f in (self.simple, self.yaml, self.json): self.assertEqual(f, confighelper.find_file(f)) self.assertEqual( f, confighelper.find_file(default_bases=(os.path.basename(f), ), default_directories=[self.datapath]))
def test_find_conf_file(self): assert confighelper.find_file(self.yaml) == self.yaml real_path = os.path.realpath(os.path.dirname(__file__)) self.assertEqual( confighelper.find_file(default_directories=[real_path], default_bases=[self.yaml]), os.path.realpath(self.yaml), )
def test_find_conf_file(self): assert confighelper.find_file(self.yaml) == self.yaml real_path = os.path.realpath(os.path.dirname(__file__)) self.assertEqual( confighelper.find_file(default_directories=[real_path], default_bases=[self.yaml]), os.path.realpath(self.yaml) )
def testMissingConfig(self): with self.assertRaises(Exception): confighelper.find_file('imaginary.yaml', (os.path.dirname(__file__), ))
def testMissingConfig(self): with self.assertRaises(Exception): confighelper.find_file('imaginary.yaml', (os.path.dirname(__file__),))
def test_find_file(self): for f in (self.simple, self.yaml, self.json): self.assertEqual(f, confighelper.find_file(f)) self.assertEqual(f, confighelper.find_file(default_bases=(os.path.basename(f),), default_directories=[self.datapath]))