def test_evaluate_nix_expression_raises_exception_when_executable_not_found( logger): nix = Nix(executable_directory="/does-not-exist", logger=logger) with pytest.raises(ExecutableNotFound): nix.evaluate_expression("true")
def expression_evaluater(nix: Nix): return lambda expression: nix.evaluate_expression( "let pkgs = import <nixpkgs> {}; in " + expression)
def test_can_evaluate_nix_expression(network_file: NetworkFile, nix: Nix): expression = f"let pkgs = import <nixpkgs> {{}}; in {network_file.nix_expression()}" nix.evaluate_expression(expression)
def expression_evaluater(logger): nix_instance = Nix(logger=logger) return lambda expression: nix_instance.evaluate_expression( "let pkgs = import <nixpkgs> {}; in " + expression )