@@ -591,31 +591,6 @@ def test_main_multi_input(monkeypatch, capsys):
591591 assert test_cases [3 ] in stdout
592592
593593
594- def test_main_input_shim (monkeypatch , capsys ):
595- import json
596- monkeypatch .setattr ('sys.version_info' , (2 , 7 ))
597- test_email = b"google@google.com"
598- monkeypatch .setattr ('sys.argv' , ['email_validator' , test_email ])
599- validator_command_line_tool ()
600- stdout , _ = capsys .readouterr ()
601- output = json .loads (str (stdout ))
602- assert isinstance (output , dict )
603- assert validate_email (test_email ).original_email == output ["original_email" ]
604-
605-
606- def test_main_output_shim (monkeypatch , capsys ):
607- monkeypatch .setattr ('sys.version_info' , (2 , 7 ))
608- test_email = b"test@.com"
609- monkeypatch .setattr ('sys.argv' , ['email_validator' , test_email ])
610- validator_command_line_tool ()
611- stdout , _ = capsys .readouterr ()
612-
613- # This looks bad but it has to do with the way python 2.7 prints vs py3
614- # The \n is part of the print statement, not part of the string, which is what the b'...' is
615- # Since we're mocking py 2.7 here instead of actually using 2.7, this was the closest I could get
616- assert stdout == "b'An email address cannot have a period immediately after the @-sign.'\n "
617-
618-
619594def test_validate_email__with_caching_resolver ():
620595 # unittest.mock.patch("dns.resolver.LRUCache.get") doesn't
621596 # work --- it causes get to always return an empty list.
0 commit comments