1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146
|
Description: Replace mock with unittest.mock
#Generated by
shopt -s globstar
dpkg-source --before-build .
for f0 in pagure/**/*.py tests/**/*.py dev-data.py ; do sed -i -E -e 's/import mock$/import unittest.mock as mock/g' -e 's/from mock import/from unittest.mock import/g' ${f0} ; done
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/1093648
Forwarded: no
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -34,7 +34,7 @@ from datetime import timedelta
from functools import wraps
from six.moves.urllib.parse import urlparse, parse_qs
-import mock
+import unittest.mock as mock
import pygit2
import redis
import six
--- a/tests/test_pagure_admin.py
+++ b/tests/test_pagure_admin.py
@@ -20,7 +20,7 @@ import unittest # noqa
import pygit2
import munch # noqa
-from mock import patch, MagicMock # noqa
+from unittest.mock import patch, MagicMock # noqa
from six import StringIO # noqa
sys.path.insert(
--- a/tests/test_pagure_exclude_group_index.py
+++ b/tests/test_pagure_exclude_group_index.py
@@ -15,7 +15,7 @@ import shutil
import sys
import os
-import mock
+import unittest.mock as mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask.py
+++ b/tests/test_pagure_flask.py
@@ -15,7 +15,7 @@ import shutil
import sys
import os
-import mock
+import unittest.mock as mock
import munch
import pygit2
--- a/tests/test_pagure_flask_api.py
+++ b/tests/test_pagure_flask_api.py
@@ -16,7 +16,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_auth.py
+++ b/tests/test_pagure_flask_api_auth.py
@@ -16,7 +16,7 @@ import sys
import os
import json
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_boards.py
+++ b/tests/test_pagure_flask_api_boards.py
@@ -17,7 +17,7 @@ import os
import json
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_fork.py
+++ b/tests/test_pagure_flask_api_fork.py
@@ -17,7 +17,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_fork_assign.py
+++ b/tests/test_pagure_flask_api_fork_assign.py
@@ -22,7 +22,7 @@ import os
import flask
import json
import munch
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
from sqlalchemy.exc import SQLAlchemyError
sys.path.insert(
--- a/tests/test_pagure_flask_api_fork_update.py
+++ b/tests/test_pagure_flask_api_fork_update.py
@@ -22,7 +22,7 @@ import os
import flask
import json
import munch
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
from sqlalchemy.exc import SQLAlchemyError
sys.path.insert(
--- a/tests/test_pagure_flask_api_issue.py
+++ b/tests/test_pagure_flask_api_issue.py
@@ -23,7 +23,7 @@ import flask
import json
import munch
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
from sqlalchemy.exc import SQLAlchemyError
sys.path.insert(
--- a/tests/test_pagure_flask_api_issue_change_status.py
+++ b/tests/test_pagure_flask_api_issue_change_status.py
@@ -19,7 +19,7 @@ import time
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_issue_comment.py
+++ b/tests/test_pagure_flask_api_issue_comment.py
@@ -17,7 +17,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_issue_create.py
+++ b/tests/test_pagure_flask_api_issue_create.py
@@ -16,7 +16,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_issue_custom_fields.py
+++ b/tests/test_pagure_flask_api_issue_custom_fields.py
@@ -13,7 +13,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_issue_update.py
+++ b/tests/test_pagure_flask_api_issue_update.py
@@ -13,7 +13,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_plugins_install.py
+++ b/tests/test_pagure_flask_api_plugins_install.py
@@ -16,7 +16,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_plugins_remove.py
+++ b/tests/test_pagure_flask_api_plugins_remove.py
@@ -16,7 +16,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_plugins_view.py
+++ b/tests/test_pagure_flask_api_plugins_view.py
@@ -15,7 +15,7 @@ import sys
import os
import json
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_plugins_view_project.py
+++ b/tests/test_pagure_flask_api_plugins_view_project.py
@@ -15,7 +15,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_pr_flag.py
+++ b/tests/test_pagure_flask_api_pr_flag.py
@@ -15,7 +15,7 @@ import sys
import os
import json
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_project.py
+++ b/tests/test_pagure_flask_api_project.py
@@ -21,7 +21,7 @@ import os
import pygit2
from celery.result import EagerResult
-from mock import ANY, patch, Mock
+from unittest.mock import ANY, patch, Mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_project_blockuser.py
+++ b/tests/test_pagure_flask_api_project_blockuser.py
@@ -22,7 +22,7 @@ import os
import flask
import json
import munch
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
from sqlalchemy.exc import SQLAlchemyError
sys.path.insert(
--- a/tests/test_pagure_flask_api_project_contributors.py
+++ b/tests/test_pagure_flask_api_project_contributors.py
@@ -22,7 +22,7 @@ import os
import flask
import json
import munch
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
from sqlalchemy.exc import SQLAlchemyError
sys.path.insert(
--- a/tests/test_pagure_flask_api_project_delete_project.py
+++ b/tests/test_pagure_flask_api_project_delete_project.py
@@ -20,7 +20,7 @@ import os
import pygit2
from celery.result import EagerResult
-from mock import patch, Mock
+from unittest.mock import patch, Mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_project_git_alias.py
+++ b/tests/test_pagure_flask_api_project_git_alias.py
@@ -17,7 +17,7 @@ import os
import json
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_project_hascommit.py
+++ b/tests/test_pagure_flask_api_project_hascommit.py
@@ -22,7 +22,7 @@ import os
import flask
import json
import munch
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
from sqlalchemy.exc import SQLAlchemyError
sys.path.insert(
--- a/tests/test_pagure_flask_api_project_update_watch.py
+++ b/tests/test_pagure_flask_api_project_update_watch.py
@@ -19,7 +19,7 @@ import time
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_project_view_file.py
+++ b/tests/test_pagure_flask_api_project_view_file.py
@@ -20,7 +20,7 @@ import os
import pygit2
from celery.result import EagerResult
-from mock import patch, Mock
+from unittest.mock import patch, Mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_ui_private_repo.py
+++ b/tests/test_pagure_flask_api_ui_private_repo.py
@@ -11,7 +11,7 @@ import os
import json
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_api_user.py
+++ b/tests/test_pagure_flask_api_user.py
@@ -18,7 +18,7 @@ import sys
import unittest
import json
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_docs.py
+++ b/tests/test_pagure_flask_docs.py
@@ -16,9 +16,9 @@ import shutil
import sys
import os
-import mock
+import unittest.mock as mock
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_dump_load_ticket.py
+++ b/tests/test_pagure_flask_dump_load_ticket.py
@@ -19,7 +19,7 @@ import time
import os
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_form.py
+++ b/tests/test_pagure_flask_form.py
@@ -18,7 +18,7 @@ import os
import flask
import flask_wtf
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_internal.py
+++ b/tests/test_pagure_flask_internal.py
@@ -19,7 +19,7 @@ import time
import os
import pygit2
-from mock import patch, MagicMock, Mock
+from unittest.mock import patch, MagicMock, Mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_rebase.py
+++ b/tests/test_pagure_flask_rebase.py
@@ -18,7 +18,7 @@ import os
import json
import pygit2
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_app.py
+++ b/tests/test_pagure_flask_ui_app.py
@@ -20,7 +20,7 @@ import os
import six
import json
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_app_browse.py
+++ b/tests/test_pagure_flask_ui_app_browse.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_app_give_project.py
+++ b/tests/test_pagure_flask_ui_app_give_project.py
@@ -16,7 +16,7 @@ import sys
import tempfile
import os
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_app_index.py
+++ b/tests/test_pagure_flask_ui_app_index.py
@@ -19,7 +19,7 @@ import os
import six
import json
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_app_userdash.py
+++ b/tests/test_pagure_flask_ui_app_userdash.py
@@ -19,7 +19,7 @@ import os
import six
import json
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_archives.py
+++ b/tests/test_pagure_flask_ui_archives.py
@@ -15,7 +15,7 @@ import sys
import os
from zipfile import ZipFile
-import mock
+import unittest.mock as mock
import pygit2
sys.path.insert(
--- a/tests/test_pagure_flask_ui_boards.py
+++ b/tests/test_pagure_flask_ui_boards.py
@@ -16,7 +16,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
import pygit2
import pytest
--- a/tests/test_pagure_flask_ui_clone.py
+++ b/tests/test_pagure_flask_ui_clone.py
@@ -21,7 +21,7 @@ import os
import six
import json
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_fork.py
+++ b/tests/test_pagure_flask_ui_fork.py
@@ -23,7 +23,7 @@ import pygit2
import six
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_groups.py
+++ b/tests/test_pagure_flask_ui_groups.py
@@ -16,7 +16,7 @@ import sys
import os
import json
-from mock import ANY, patch
+from unittest.mock import ANY, patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_issue_pr_link.py
+++ b/tests/test_pagure_flask_ui_issue_pr_link.py
@@ -21,7 +21,7 @@ import time
import os
import pygit2
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_issues.py
+++ b/tests/test_pagure_flask_ui_issues.py
@@ -29,7 +29,7 @@ from six.moves.urllib.parse import urlpa
import pygit2
from bs4 import BeautifulSoup
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_issues_acl_checks.py
+++ b/tests/test_pagure_flask_ui_issues_acl_checks.py
@@ -25,7 +25,7 @@ except ImportError:
import tempfile
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_issues_open_access.py
+++ b/tests/test_pagure_flask_ui_issues_open_access.py
@@ -29,7 +29,7 @@ from six.moves.urllib.parse import urlpa
import pygit2
from bs4 import BeautifulSoup
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_issues_private.py
+++ b/tests/test_pagure_flask_ui_issues_private.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_issues_read_only.py
+++ b/tests/test_pagure_flask_ui_issues_read_only.py
@@ -15,7 +15,7 @@ import unittest
import sys
import os
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_issues_templates.py
+++ b/tests/test_pagure_flask_ui_issues_templates.py
@@ -16,7 +16,7 @@ import sys
import os
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_login.py
+++ b/tests/test_pagure_flask_ui_login.py
@@ -23,7 +23,7 @@ import os
import flask
import pygit2
import six
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_no_master_branch.py
+++ b/tests/test_pagure_flask_ui_no_master_branch.py
@@ -18,7 +18,7 @@ import tempfile
import os
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_oidc_login.py
+++ b/tests/test_pagure_flask_ui_oidc_login.py
@@ -19,7 +19,7 @@ import sys
import os
import flask
-from mock import patch, Mock
+from unittest.mock import patch, Mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_old_commit.py
+++ b/tests/test_pagure_flask_ui_old_commit.py
@@ -15,7 +15,7 @@ import sys
import os
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_plugins_default_hook.py
+++ b/tests/test_pagure_flask_ui_plugins_default_hook.py
@@ -18,7 +18,7 @@ import os
import flask
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_plugins_fedmsg.py
+++ b/tests/test_pagure_flask_ui_plugins_fedmsg.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_plugins_mirror.py
+++ b/tests/test_pagure_flask_ui_plugins_mirror.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_plugins_pagure_ci.py
+++ b/tests/test_pagure_flask_ui_plugins_pagure_ci.py
@@ -6,7 +6,7 @@ import unittest
import sys
import os
-import mock
+import unittest.mock as mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_plugins_pagure_hook.py
+++ b/tests/test_pagure_flask_ui_plugins_pagure_hook.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_pr_bidi.py
+++ b/tests/test_pagure_flask_ui_pr_bidi.py
@@ -15,7 +15,7 @@ import sys
import os
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_pr_edit.py
+++ b/tests/test_pagure_flask_ui_pr_edit.py
@@ -10,7 +10,7 @@ from __future__ import unicode_literals,
import sys
import os
-from mock import ANY, patch
+from unittest.mock import ANY, patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_pr_no_sources.py
+++ b/tests/test_pagure_flask_ui_pr_no_sources.py
@@ -19,7 +19,7 @@ import time
import os
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_priorities.py
+++ b/tests/test_pagure_flask_ui_priorities.py
@@ -19,7 +19,7 @@ import tempfile
import os
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_quick_reply.py
+++ b/tests/test_pagure_flask_ui_quick_reply.py
@@ -10,7 +10,7 @@
from __future__ import unicode_literals, absolute_import
-import mock
+import unittest.mock as mock
import os
import sys
import unittest
--- a/tests/test_pagure_flask_ui_remote_pr.py
+++ b/tests/test_pagure_flask_ui_remote_pr.py
@@ -22,7 +22,7 @@ import unittest
import pygit2
import werkzeug
import wtforms
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
from bs4 import BeautifulSoup
sys.path.insert(
--- a/tests/test_pagure_flask_ui_repo.py
+++ b/tests/test_pagure_flask_ui_repo.py
@@ -28,7 +28,7 @@ except ImportError:
import pygit2
import six
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_repo_delete_project.py
+++ b/tests/test_pagure_flask_ui_repo_delete_project.py
@@ -13,7 +13,7 @@ from __future__ import unicode_literals,
import sys
import os
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_repo_flag_commit.py
+++ b/tests/test_pagure_flask_ui_repo_flag_commit.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch
+from unittest.mock import patch
import pygit2
sys.path.insert(
--- a/tests/test_pagure_flask_ui_repo_milestones.py
+++ b/tests/test_pagure_flask_ui_repo_milestones.py
@@ -14,7 +14,7 @@ import sys
import unittest
import os
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_repo_mirrored_from.py
+++ b/tests/test_pagure_flask_ui_repo_mirrored_from.py
@@ -20,7 +20,7 @@ import unittest
import pygit2
import six
-from mock import patch, MagicMock, ANY, call
+from unittest.mock import patch, MagicMock, ANY, call
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_repo_slash_name.py
+++ b/tests/test_pagure_flask_ui_repo_slash_name.py
@@ -18,7 +18,7 @@ import tempfile
import os
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_roadmap.py
+++ b/tests/test_pagure_flask_ui_roadmap.py
@@ -19,7 +19,7 @@ import tempfile
import os
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_ui_slash_branch_name.py
+++ b/tests/test_pagure_flask_ui_slash_branch_name.py
@@ -18,7 +18,7 @@ import tempfile
import os
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_flask_util.py
+++ b/tests/test_pagure_flask_util.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_hooks_pagure_hook.py
+++ b/tests/test_pagure_hooks_pagure_hook.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-import mock
+import unittest.mock as mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib.py
+++ b/tests/test_pagure_lib.py
@@ -18,7 +18,7 @@ import os
import pygit2
import markdown
-from mock import patch, MagicMock, Mock
+from unittest.mock import patch, MagicMock, Mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_add_user_to_project.py
+++ b/tests/test_pagure_lib_add_user_to_project.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_drop_issue.py
+++ b/tests/test_pagure_lib_drop_issue.py
@@ -15,7 +15,7 @@ import shutil
import sys
import os
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_git.py
+++ b/tests/test_pagure_lib_git.py
@@ -20,7 +20,7 @@ import unittest
import pygit2
import six
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_git_auth.py
+++ b/tests/test_pagure_lib_git_auth.py
@@ -21,7 +21,7 @@ import unittest
import pygit2
import six
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_git_auth_paguregitauth.py
+++ b/tests/test_pagure_lib_git_auth_paguregitauth.py
@@ -15,7 +15,7 @@ import json
import os
import sys
-from mock import Mock
+from unittest.mock import Mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_git_diff_pr.py
+++ b/tests/test_pagure_lib_git_diff_pr.py
@@ -19,7 +19,7 @@ import time # noqa
import os # noqa
import pygit2 # noqa
-from mock import ANY, patch, MagicMock
+from unittest.mock import ANY, patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_git_mirror_project.py
+++ b/tests/test_pagure_lib_git_mirror_project.py
@@ -20,7 +20,7 @@ import unittest
import pygit2
import six
-from mock import patch, MagicMock, ANY, call
+from unittest.mock import patch, MagicMock, ANY, call
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_gitolite_config.py
+++ b/tests/test_pagure_lib_gitolite_config.py
@@ -20,7 +20,7 @@ import unittest
from io import open
import pygit2
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_link.py
+++ b/tests/test_pagure_lib_link.py
@@ -17,7 +17,7 @@ import sys
import os
import pygit2
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_login.py
+++ b/tests/test_pagure_lib_login.py
@@ -18,7 +18,7 @@ import os
import hashlib
import six
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_model.py
+++ b/tests/test_pagure_lib_model.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_notify.py
+++ b/tests/test_pagure_lib_notify.py
@@ -15,7 +15,7 @@ import shutil
import sys
import os
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_notify_email.py
+++ b/tests/test_pagure_lib_notify_email.py
@@ -14,7 +14,7 @@ import unittest
import sys
import os
-import mock
+import unittest.mock as mock
import munch
import six
--- a/tests/test_pagure_lib_plugins.py
+++ b/tests/test_pagure_lib_plugins.py
@@ -12,7 +12,7 @@ from __future__ import unicode_literals,
import os
import sys
-from mock import patch
+from unittest.mock import patch
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_task_mirror.py
+++ b/tests/test_pagure_lib_task_mirror.py
@@ -20,7 +20,7 @@ import unittest
import pygit2
import six
-from mock import patch, MagicMock, call
+from unittest.mock import patch, MagicMock, call
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_task_services.py
+++ b/tests/test_pagure_lib_task_services.py
@@ -20,7 +20,7 @@ import unittest
import pygit2
import six
-from mock import ANY, patch, MagicMock, call
+from unittest.mock import ANY, patch, MagicMock, call
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_lib_watch_list.py
+++ b/tests/test_pagure_lib_watch_list.py
@@ -15,7 +15,7 @@ import shutil
import sys
import os
-import mock
+import unittest.mock as mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_merge_pr_no_fork.py
+++ b/tests/test_pagure_merge_pr_no_fork.py
@@ -15,7 +15,7 @@ import sys
import os
import json
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_repospanner.py
+++ b/tests/test_pagure_repospanner.py
@@ -27,7 +27,7 @@ import pygit2
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
-from mock import patch, MagicMock
+from unittest.mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
--- a/tests/test_pagure_send_notification.py
+++ b/tests/test_pagure_send_notification.py
@@ -16,7 +16,7 @@ sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
)
-import mock
+import unittest.mock as mock
import pygit2
import pagure.hooks.default
--- a/tests/test_pagure_utils.py
+++ b/tests/test_pagure_utils.py
@@ -15,7 +15,7 @@ import shutil
import sys
import os
-import mock
+import unittest.mock as mock
import munch
import pygit2
--- a/tests/test_pfmarkdown.py
+++ b/tests/test_pfmarkdown.py
@@ -13,7 +13,7 @@ from __future__ import unicode_literals,
import unittest
from xml.etree import ElementTree
-from mock import patch, Mock
+from unittest.mock import patch, Mock
from pagure import pfmarkdown
from pagure.lib import model
--- a/tests/test_stream_server.py
+++ b/tests/test_stream_server.py
@@ -21,7 +21,7 @@ import os
import sys
import unittest
-import mock
+import unittest.mock as mock
import six
sys.path.insert(
--- a/tests/test_tasks.py
+++ b/tests/test_tasks.py
@@ -1,6 +1,6 @@
from __future__ import unicode_literals, absolute_import
-from mock import patch, MagicMock, Mock
+from unittest.mock import patch, MagicMock, Mock
from collections import namedtuple
import os
import unittest
|