public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Steve Traylen <steve.traylen@cern.ch>
To: git-commits@fedoraproject.org
Subject: [rpms/python-httmock] epel10: Update to 1.3.0
Date: Sat, 10 Oct 2026 07:52:22 GMT	[thread overview]
Message-ID: <179161874291.1.15008080809140142131.rpms-python-httmock-5d192ad7854b@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-httmock
Branch : epel10
Commit : 5d192ad7854b41c1591455178409833d05347c7d
Author : Steve Traylen <steve.traylen@cern.ch>
Date   : 2019-11-13T12:06:58+01:00
Stats  : +43/-3 in 4 file(s)
URL    : https://src.fedoraproject.org/rpms/python-httmock/c/5d192ad7854b41c1591455178409833d05347c7d?branch=epel10

Log:
Update to 1.3.0

---
diff --git a/.gitignore b/.gitignore
index adc2300..99f6d2b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
 /httmock-1.2.6.tar.gz
+/httmock-1.3.0.tar.gz
+/tests.py

diff --git a/python-httmock.spec b/python-httmock.spec
index a7c0490..4de895e 100644
--- a/python-httmock.spec
+++ b/python-httmock.spec
@@ -3,8 +3,8 @@
 %global pypi_name httmock
 
 Name:           python-%{pypi_name}
-Version:        1.2.6
-Release:        9%{?dist}
+Version:        1.3.0
+Release:        1%{?dist}
 Summary:        A mocking library for requests
 
 License:        ASL 2.0
@@ -53,6 +53,9 @@ cp %{SOURCE1} .
 %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
 
 %changelog
+* Wed Nov 13 2019 Steve Traylen <steve.traylen@cern.ch> - 1.3.0-1
+- Update to 1.3.0
+
 * Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.2.6-9
 - Rebuilt for Python 3.8.0rc1 (#1748018)
 

diff --git a/sources b/sources
index be3e2e0..29df162 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
-SHA512 (httmock-1.2.6.tar.gz) = a31b4a28383c052bb15ca5c2f07f96c8654f44d15df05fa7972e410b9c1a40f70c6ed48256dd7cf3a0486f8555142ba59330edd9c8beb003785ecdb535ddfb69
+SHA512 (tests.py) = f869c9923bdd68c8758c1937eb61a7b8e2aae1ef32dce9ca850460dfdfd8daae7c20e1e5b9c298c1ce600900cbe2c34ba9660bd0ded0dbd34e817e39a18eee72
+SHA512 (httmock-1.3.0.tar.gz) = f713ddf45675738582a3611e01a55babce2951231b34fb9ca6b1b64fcf60a3862994ff7ad4cd7a224a116c6acb1caa267978a7cb6fedd02676fa2a01f90e93aa

diff --git a/tests.py b/tests.py
index 7a13cb3..c396192 100644
--- a/tests.py
+++ b/tests.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 import requests
 import unittest
 
@@ -41,6 +42,22 @@ def facebook_mock(url, request):
 def facebook_mock_count(url, request):
     return 'Hello from Facebook'
 
+@urlmatch(netloc=r'(.*\.)?google\.com$', path=r'^/$', method='POST')
+@remember_called
+def google_mock_store_requests(url, request):
+    return 'Posting at Google'
+
+
+@all_requests
+def charset_utf8(url, request):
+    return {
+        'content': u'Motörhead'.encode('utf-8'),
+        'status_code': 200,
+        'headers': {
+            'Content-Type': 'text/plain; charset=utf-8'
+        }
+    }
+
 
 def any_mock(url, request):
     return 'Hello from %s' % (url.netloc,)
@@ -112,6 +129,13 @@ class MockTest(unittest.TestCase):
         with HTTMock(response_content):
             self.assertRaises(TypeError, requests.get, 'http://example.com/')
 
+    def test_encoding_from_contenttype(self):
+        with HTTMock(charset_utf8):
+            r = requests.get('http://example.com/')
+        self.assertEqual(r.encoding, 'utf-8')
+        self.assertEqual(r.text, u'Motörhead')
+        self.assertEqual(r.content, r.text.encode('utf-8'))
+
 
 class DecoratorTest(unittest.TestCase):
 
@@ -334,3 +358,13 @@ class RememberCalledTest(unittest.TestCase):
 
         self.several_calls(1, requests.get, 'http://facebook.com/')
         self.assertEquals(facebook_mock_count.call['count'], 4)
+
+    def test_store_several_requests(self):
+        with HTTMock(google_mock_store_requests):
+            payload = {"query": "foo"}
+            requests.post('http://google.com', data=payload)
+
+        self.assertTrue(google_mock_store_requests.call['called'])
+        self.assertEqual(google_mock_store_requests.call['count'], 1)
+        request = google_mock_store_requests.call['requests'][0]
+        self.assertEqual(request.body, 'query=foo')

                 reply	other threads:[~2026-10-10  7:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179161874291.1.15008080809140142131.rpms-python-httmock-5d192ad7854b@fedoraproject.org \
    --to=steve.traylen@cern.ch \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox