def test_handle_single_change(self, fake_find_file, fake_command_line): fake_find_file.return_value = None fake_command_line.return_value = 1 from moban.main import main with patch.object(sys, "argv", ["moban"]): main()
def test_has_many_files(self, fake_find_file, fake_moban_file): fake_find_file.return_value = "abc" fake_moban_file.return_value = 1 from moban.main import main with patch.object(sys, "argv", ["moban"]): main()
def test_no_third_party_engine(self, fake_reporter, fake_moban_file, fake_file): fake_file.return_value = True fake_moban_file.side_effect = exceptions.NoThirdPartyEngine from moban.main import main with patch.object(sys, "argv", ["moban"]): main()
def test_directory_not_found(self, fake_reporter, fake_moban_file, fake_file): fake_file.return_value = True fake_moban_file.side_effect = exceptions.DirectoryNotFound from moban.main import main with patch.object(sys, "argv", ["moban"]): main()
def test_double_underscore_main(self, fake_reporter, fake_moban_file, fake_file): fake_file.return_value = True fake_moban_file.side_effect = exceptions.DirectoryNotFound from moban.__main__ import main with patch.object(sys, "argv", ["moban"]): main()
def test_unknown_protocol(self, fake_reporter, fake_moban_file, fake_file): fake_file.return_value = True fake_moban_file.side_effect = exceptions.UnsupportedPyFS2Protocol fake_stdin = MagicMock(isatty=MagicMock(return_value=True)) with patch.object(sys, "stdin", fake_stdin): from moban.main import main with patch.object(sys, "argv", ["moban"]): main()
def test_directory_not_found(self, fake_reporter, fake_moban_file, fake_file): fake_file.return_value = True fake_moban_file.side_effect = exceptions.DirectoryNotFound fake_stdin = MagicMock(isatty=MagicMock(return_value=True)) with patch.object(sys, "stdin", fake_stdin): with patch.object(sys, "argv", ["moban"]): from moban.main import main main()