def test_hifen_e_campo_10(self): args = ['', 'quote'] with unittest.mock.patch.object(sys, 'argv', args): sinais.main() saida = sys.stdout.getvalue() self.assertEqual( saida, "U+0027\t'\tAPOSTROPHE (APOSTROPHE-QUOTE)\n" 'U+2358\t⍘\tAPL FUNCTIONAL SYMBOL QUOTE UNDERBAR\n' 'U+235E\t⍞\tAPL FUNCTIONAL SYMBOL QUOTE QUAD\n')
def test_dois_args(self): args = ['', 'cat', 'smiling'] with unittest.mock.patch.object(sys, 'argv', args): sinais.main() saida = sys.stdout.getvalue() self.assertEqual( saida, 'U+1F638\t😸\tGRINNING CAT FACE WITH SMILING EYES\n' 'U+1F63A\t😺\tSMILING CAT FACE WITH OPEN MOUTH\n' 'U+1F63B\t😻\tSMILING CAT FACE WITH HEART-SHAPED EYES\n')
def test_main_multiple_results(capsys): main('CHESS', 'BLACK') captured = capsys.readouterr() assert captured.out == '\n'.join([ 'U+265A\t♚\tBLACK CHESS KING', 'U+265B\t♛\tBLACK CHESS QUEEN', 'U+265C\t♜\tBLACK CHESS ROOK', 'U+265D\t♝\tBLACK CHESS BISHOP', 'U+265E\t♞\tBLACK CHESS KNIGHT', 'U+265F\t♟\tBLACK CHESS PAWN', ]) + '\n'
def test_user_dont_input_anything(capsys): main() captured = capsys.readouterr() assert captured.err == 'Please provide one word or more\n'
def test_we_dont_have_result(capsys): main('batata') captured = capsys.readouterr() assert captured.err == 'No results\n'
def test_main_single_result(capsys): main('REGISTERED') captured = capsys.readouterr() assert captured.out == 'U+00AE\t®\tREGISTERED SIGN\n'
def test_main(capsys): main(['registered']) captured = capsys.readouterr() assert captured.out == "U+00AE\t®\tREGISTERED SIGN\n"
def test_um_arg(self): args = ['', 'cruzeiro'] with unittest.mock.patch.object(sys, 'argv', args): sinais.main() saida = sys.stdout.getvalue() self.assertEqual(saida, 'U+20A2\t₢\tCRUZEIRO SIGN\n')