def test_find_tests_config_none(self): """ Test that if no configuration file is present, None is returned :return: """ assert BehaveWorkingDirectory.find_tests_config( self.WORKING_DIR) is None
def test_find_tests_config_multiple(self): """ Test that configuration files are found and that .ini has preference :return: """ files = [ 'test.ini', 'tests.conf', ] for f in files: with open(f, 'w') as fw: fw.write('xyz') assert BehaveWorkingDirectory.find_tests_config(self.WORKING_DIR) == os.path.join(self.WORKING_DIR, files[0])
def test_find_tests_config_multiple(self): """ Test that configuration files are found and that .ini has preference :return: """ files = [ 'test.ini', 'tests.conf', ] for f in files: with open(f, 'w') as fw: fw.write('xyz') assert BehaveWorkingDirectory.find_tests_config( self.WORKING_DIR) == os.path.join(self.WORKING_DIR, files[0])
def test_find_tests_config_existing(self): """ Test that configuration files are successfully found :return: """ files = [ 'test.ini', 'tests.ini', 'test.conf', 'tests.conf', ] for f in files: with open(f, 'w') as fw: fw.write('xyz') assert BehaveWorkingDirectory.find_tests_config(self.WORKING_DIR) == os.path.join(self.WORKING_DIR, f) os.remove(f) assert not os.path.exists(f)
def test_find_tests_config_existing(self): """ Test that configuration files are successfully found :return: """ files = [ 'test.ini', 'tests.ini', 'test.conf', 'tests.conf', ] for f in files: with open(f, 'w') as fw: fw.write('xyz') assert BehaveWorkingDirectory.find_tests_config( self.WORKING_DIR) == os.path.join(self.WORKING_DIR, f) os.remove(f) assert not os.path.exists(f)
def test_find_tests_config_none(self): """ Test that if no configuration file is present, None is returned :return: """ assert BehaveWorkingDirectory.find_tests_config(self.WORKING_DIR) is None