Skip to content

Commit

Permalink
Buat tes untuk autentikasi yang gagal
Browse files Browse the repository at this point in the history
  • Loading branch information
laymonage committed Mar 25, 2020
1 parent f6e0b31 commit b894ecb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ def test_autentikasi_tanpa_argumen_sama_dengan_bantuan(monkeypatch, capsys):
tangkap = capsys.readouterr()
assert tangkap.out == bantuan
assert hasil == 0


def test_autentikasi_gagal(monkeypatch, capsys):
monkeypatch.setattr(kbbi.AutentikasiKBBI, "host", "http://localhost:8000")
monkeypatch.setattr(kbbi.AutentikasiKBBI, "lokasi", "Account/Login.html")
hasil = kbbi.autentikasi(["[email protected]", "sandi_saya"])
tangkap = capsys.readouterr()
assert tangkap.out == (
"Gagal melakukan autentikasi dengan alamat posel dan sandi "
"yang diberikan.\n"
)
assert hasil == 1

0 comments on commit b894ecb

Please sign in to comment.