Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More tests for update passphrase via CLI #535

Merged
merged 4 commits into from
Jul 12, 2019
Merged

Conversation

piotr-iohk
Copy link
Contributor

Issue Number

#472

Overview

  • I have added more tests and made small change so CLI checks if wallet exists before attempting to update pass (which is consistent with other endpoints behaviour)

Comments

@piotr-iohk piotr-iohk self-assigned this Jul 12, 2019
if (title == "40 chars hex") then
T.unpack err `shouldContain`
"I couldn't find a wallet with the given id:\
\ 1111111111111111111111111111111111111111\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made small change so CLI checks if wallet exists before attempting to update pass (which is consistent with other endpoints behaviour)

this is tested here

Copy link
Member

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Some minor comments

(ApiT wPassphraseOld)
(ApiT wPassphraseNew)
Left _ ->
handleResponse Aeson.encodePretty res
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 noice

]

(cTx, outTx, errTx) <- postTransactionViaCLI @t ctx pass args
expectations (cTx, outTx, errTx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test seems to be lesser than its title. We check that we can make a transaction with the new passphrase, but we don't actually check that a transaction cannot be made using the old passphrase, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we don't actually check that a transaction cannot be made using the old passphrase, right ?

We do!

        let matrix =
                [ ("Old passphrase -> fail", oldPass
                  , expect (ExitFailure 1, mempty, errMsg403WrongPass)
                  )
                , ("New passphrase -> OK", newPass
                  , expectTxOK
                  )
                ]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaaaaah. Okay.

, expect (ExitFailure 1, mempty, "passphrase is too short")
)
, ( "Incorrect old passphrase", "wrong secure passphrase"
, expect (ExitFailure 1, mempty, errMsg403WrongPass)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cringed when I saw the indentation on these two lines 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take it easy ;) [will fix]

@KtorZ KtorZ merged commit 3687284 into master Jul 12, 2019
@KtorZ KtorZ deleted the piotr/update_pass_testing branch July 12, 2019 15:44
@KtorZ KtorZ added this to the Bugs & Debts - Sprint 27-28 milestone Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants