Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7687019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:36:30+00:00 2026-05-31T19:36:30+00:00

In my latest Python project, utilizing Twisted, I’ve tried to be good at using

  • 0

In my latest Python project, utilizing Twisted, I’ve tried to be good at using the unittest module. At a high level, I’m building two RESTful APIs designed specifically to talk to each other. For most requests, I can just use DummyRequest and test the rendered values against an expected constant and that’s been working fine.

However, I’ve got a few cases where the design requires a request on one server that (among other things) then sends a request to the other server, but doesn’t really care about the response. What matters is that the request happens.

Like I said, I can test that functionality on the other side perfectly fine, but I’m getting stumped on how to test to ensure that the data was sent over. My ideas so far are either

  • Set up a dummy test server that just checks to see if the request was made and validates the input – Seems flaky and too much effort
  • Set up a decorator to wrap certain tests and modify urllib.urlopen to report when it was called, what we tried to retrieve, and allow me to simply return a known result there.

I’m leaning towards the second option as it seems more pythonic, but also a bit hacky.

Thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:36:31+00:00Added an answer on May 31, 2026 at 7:36 pm

    Twisted comes with its own unit-testing framework, called Trial. As you might imagine, it’s well-suited for testing your networking code. Here’s a tutorial to start you off.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a project using python 2.7.2, sqlalchemy 0.7, unittest, eclipse 3.7.2
Using Python 2.6, Twisted 10.1, and GTK+ 2.22, with latest pygtk installed, I'm having
I'm excited to see the latest version of the decorator python module (3.0). It
I am using Eclipse 3.7.1 with the latest PyDev add-in for Python coding. I
html5lib notes that it's latest release (0.11) is somewhat old. Using the Python portion,
I'm currently working on a project using javascript and python with Jquery Datatables plugin
I'm using Python in Terminal on Mac OSX latest. When I press enter, it
The latest Python Sendkeys module is for Python 2.6. I can't upgrade it myself
I'm using the latest python release and after searching, I can't seem to find
I'm using the latest GAE default python environment. Both of these give expected results:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.