cardano-cli:cardano-cli-test-lib
Safe HaskellNone
LanguageHaskell2010

Test.Cardano.CLI.Util

Synopsis

Documentation

assertDirectoryMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #

Asserts that the given directory is missing.

checkTxCddlFormat Source #

Arguments

:: (MonadTest m, MonadIO m, HasCallStack) 
=> FilePath

Reference/golden file

-> FilePath

Newly created file

-> m () 

checkTextEnvelopeFormat :: (MonadTest m, MonadIO m, HasCallStack) => TextEnvelopeType -> FilePath -> FilePath -> m () Source #

Checks that the tvType and tvDescription are equivalent between two files.

equivalence :: (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () Source #

Check for equivalence between two types and perform a file cleanup on failure.

execCardanoCLI Source #

Arguments

:: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) 
=> [String]

Arguments to the CLI command

-> m String

Captured stdout

Execute cardano-cli via the command line.

Waits for the process to finish and returns the stdout.

execCardanoCLIWithEnvVars Source #

Arguments

:: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) 
=> [(String, String)]

Environment variables to set

-> [String]

Arguments to the CLI command

-> m String 

Execute cardano-cli via the command line but set environment variables. Fails if the process returns a non-zero exit code.

Waits for the process to finish and returns the stdout.

execDetailCardanoCLI Source #

Arguments

:: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) 
=> [String]

Arguments to the CLI command

-> m (ExitCode, String, String)

Captured stdout

Execute cardano-cli via the command line, expecting it to fail.

Waits for the process to finish and returns the exit code, stdout and stderr.

execDetailConfigCardanoCLI Source #

Arguments

:: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) 
=> ExecConfig

Configuration for the execution

-> [String]

Arguments to the CLI command

-> m (ExitCode, String, String)

Captured stdout

Execute cardano-cli via the command line, expecting it to fail, and accepting custom config.

Waits for the process to finish and returns the exit code, stdout and stderr.

tryExecCardanoCLI Source #

Arguments

:: forall (m :: Type -> Type). (MonadCatch m, MonadIO m, HasCallStack) 
=> [String]

Arguments to the CLI command

-> PropertyT m (Either Failure String)

Captured stdout, or error in case of failures

propertyOnce :: PropertyT (ResourceT IO) () -> Property Source #

withSnd :: (a -> b) -> a -> (a, b) Source #

Return the supply value with the result of the supplied function as a tuple

noteInputFile :: (MonadTest m, HasCallStack) => FilePath -> m FilePath Source #

Return the input file path after annotating it relative to the project root directory

noteTempFile :: (MonadTest m, HasCallStack) => FilePath -> FilePath -> m FilePath Source #

Return the test file path after annotating it relative to the project root directory

redactJsonField :: (MonadTest m, MonadIO m, HasCallStack) => Text -> Text -> FilePath -> FilePath -> m () Source #

expectFailure :: forall t (m :: Type -> Type) a. (MonadTrans t, MonadTest (t m), MonadCatch (t m), MonadIO m, HasCallStack) => TestT m a -> t m () Source #

Invert the behavior of a MonadTest: success becomes failure and vice versa.

watchdogProp :: HasCallStack => Property -> Property Source #