def test_path_does_not_exist(self): """Test with a path that does not exist.""" with self.assertRaises(ValueError) as exc: config.validate_path('/does/not/exist') self.assertEqual(str(exc.exception), "'/does/not/exist' does not exist.")
def test_path_exists(self): """Test with a path that exists.""" result = config.validate_path(__file__) assert result == __file__ assert isinstance(result, str)
def test_path_is_none(self): """Test with a None value.""" with pytest.raises(ValueError) as exc: config.validate_path(None) assert str(exc.value) == "None does not exist."
def test_path_does_not_exist(self): """Test with a path that does not exist.""" with pytest.raises(ValueError) as exc: config.validate_path('/does/not/exist') assert str(exc.value) == "'/does/not/exist' does not exist."
def test_path_exists(self): """Test with a path that exists.""" result = config.validate_path(__file__) self.assertEqual(result, __file__) self.assertTrue(isinstance(result, str))
def test_path_is_none(self): """Test with a None value.""" with self.assertRaises(ValueError) as exc: config.validate_path(None) self.assertEqual(str(exc.exception), "None does not exist.")