From 076fa326400cdbe381d6965d8e6cc417c8c381a0 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Thu, 1 Mar 2018 17:18:09 +0000
Subject: python-mock: update to 2.0.0

---
 abs/core/python_modules/python-mock/PKGBUILD    | 43 ++++++++++++++++---------
 abs/core/python_modules/python-mock/__changelog |  1 -
 2 files changed, 28 insertions(+), 16 deletions(-)
 delete mode 100644 abs/core/python_modules/python-mock/__changelog

diff --git a/abs/core/python_modules/python-mock/PKGBUILD b/abs/core/python_modules/python-mock/PKGBUILD
index 63fd848..c2ec77d 100644
--- a/abs/core/python_modules/python-mock/PKGBUILD
+++ b/abs/core/python_modules/python-mock/PKGBUILD
@@ -3,38 +3,51 @@
 # Contributor: Felix Kaiser <felix.kaiser@fxkr.net>
 
 pkgbase=python-mock
-pkgname=(python2-mock)
-pkgver=1.0.1
-pkgrel=3
+pkgname=(python2-mock python-mock)
+pkgver=2.0.0
+pkgrel=2
 pkgdesc='Mocking and Patching Library for Testing'
 url='http://www.voidspace.org.uk/python/mock/'
-makedepends=('python2')
+makedepends=('python2' 'python' 'python-setuptools' 'python2-setuptools')
+checkdepends=('python-nose' 'python2-nose' 'python-pbr' 'python2-pbr' 'python-six' 'python2-six' 'git')
 license=('BSD')
 arch=('any')
-source=("http://pypi.python.org/packages/source/m/mock/mock-$pkgver.tar.gz")
-md5sums=('c3971991738caa55ec7c356bbc154ee2')
+source=("https://files.pythonhosted.org/packages/source/m/mock/mock-$pkgver.tar.gz")
+md5sums=('0febfafd14330c9dcaa40de2d82d40ad')
 
 build() {
   cd "$srcdir"
   cp -rf "mock-$pkgver" "mock2-$pkgver"
 
-#  cd "$srcdir/mock-$pkgver"
-#  python3 setup.py build
+  cd "$srcdir/mock-$pkgver"
+  python3 setup.py build
 
   cd "$srcdir/mock2-$pkgver"
   python2 setup.py build
 }
 
-#package_python-mock() {
-#depends=('python')
-#  cd "$srcdir/mock-$pkgver"
-#  python3 setup.py install --optimize=1 --root="$pkgdir"
-#  install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
-#}
+package_python-mock() {
+depends=('python' 'python-six' 'python-pbr')
+  cd "$srcdir/mock-$pkgver"
+  python3 setup.py install --optimize=1 --root="$pkgdir"
+  install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+}
 
 package_python2-mock() {
-depends=('python2')
+depends=('python2' 'python2-six' 'python2-pbr' 'python2-funcsigs') # Backported Py > 3.3 functionality
   cd "$srcdir/mock2-$pkgver"
   python2 setup.py install --optimize=1 --root="$pkgdir"
   install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 }
+
+check() {
+  cd "$srcdir/mock2-$pkgver/"
+  sed -i 's/unittest2/unittest/g'  mock/tests/*.py
+
+  echo 'python tests'
+  python -m unittest discover
+  
+  # Does not run because of self.assertRaisesRegex() usage in unitests, which is self.assertRaisesRegexp() in Python 2.7
+  echo 'python2 tests'
+  #python2 -m unittest discover
+}
diff --git a/abs/core/python_modules/python-mock/__changelog b/abs/core/python_modules/python-mock/__changelog
deleted file mode 100644
index 488d3cf..0000000
--- a/abs/core/python_modules/python-mock/__changelog
+++ /dev/null
@@ -1 +0,0 @@
-PKGBUILD: rm py 3 stuff
-- 
cgit v0.12

