{"id":7993,"date":"2015-11-06T12:15:55","date_gmt":"2015-11-06T10:15:55","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=7993"},"modified":"2015-10-26T18:13:15","modified_gmt":"2015-10-26T16:13:15","slug":"mockupdb-testing-mongodb-c-driver-python","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/","title":{"rendered":"MockupDB: Testing The MongoDB C Driver With Python"},"content":{"rendered":"<p>This is the third article in my <a href=\"http:\/\/emptysqua.re\/blog\/black-pipe-testing-series\/\">series on &#8220;black pipe&#8221; testing<\/a>. The series describes how to test networked code, like a MongoDB driver.<\/p>\n<p>Such code has two distinct public surfaces: one is its API, and the other is its communication over the network. Treating it as a black box tests just one surface, the API.<\/p>\n<p>To test both, we should treat it as a &#8220;black pipe&#8221; with inputs and outputs at both ends.<\/p>\n<p>In this article, I describe how I used a Python library to perform black pipe testing on the MongoDB C Driver.<\/p>\n<h2>Scary bugs<\/h2>\n<p>I took over the C Driver this spring, and immediately ran into a storm of critical issues. Customers were reporting intermittent hangs and crashes that I couldn&#8217;t reproduce on my own system.<\/p>\n<p>An example: a customer reported that if he stopped the MongoDB server while the driver was in the middle of an operation, and the driver was connected with TLS, then the driver sometimes waited until its network timeout expired. If the connection was not TLS, the driver detected the closed connection immediately.<\/p>\n<p>I was in Montr\u00e9al, speaking at PyCon, the day this was reported from an important customer. It made me terrifically anxious. How was I supposed to reproduce an intermittent hang that depended on subtle timing? Especially when I was away from the office, on my own, and in the midst of all my conference obligations?<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits-black-and-white.jpg\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-8022\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits-black-and-white-1024x682.jpg\" alt=\"circuits-black-and-white\" width=\"620\" height=\"413\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits-black-and-white-1024x682.jpg 1024w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits-black-and-white-300x200.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits-black-and-white.jpg 1200w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>He sent me a stack trace, so I could begin to form a hypothesis and a solution. The hypothesis was that we didn&#8217;t handle all the details of OpenSSL&#8217;s error-checking API. An unfortunate sequence went like this: the driver connected to the server, did the TLS handshake, and had at least one successful request-response cycle. Then, the driver sent a command to the server and instead of responding, the server did a clean shutdown of the connection. The driver should have known the connection was closed, but instead it sat waiting until it timed out.<\/p>\n<p>My solution was a finicky bit of code:<\/p>\n<pre class=\" brush:php\">\/* read from a connection with TLS *\/\r\nread_ret = BIO_read (tls-&gt;bio, buf, buflen);\r\n\r\nif (read_ret &lt; 0 || (read_ret == 0 &amp;&amp; !BIO_should_retry (tls-&gt;bio))) {\r\n   \/* error or closed connection *\/\r\n   return -1;\r\n}<\/pre>\n<p>It looked right to me, but the OpenSSL manual was unclear. I would not ship the code without a reliable reproduction of the bug and a test that proved I had fixed it.<\/p>\n<h2>Testing the C Driver with MockupDB<\/h2>\n<p>I needed MongoDB to close the connection at just the wrong microsecond in order to tickle the bug. The timing was much too tight for a manual test, or even an automated test that shut down the MongoDB server. So I pulled out a tool I&#8217;d written in Python called <a href=\"http:\/\/mockupdb.readthedocs.org\/\">MockupDB<\/a>, a <a href=\"http:\/\/docs.mongodb.org\/meta-driver\/latest\/legacy\/mongodb-wire-protocol\/\">MongoDB wire protocol<\/a> server. (MockupDB was the subject of <a href=\"http:\/\/emptysqua.re\/blog\/black-pipe-testing-pymongo\/\">last week&#8217;s article<\/a>.) I built it to subject PyMongo to &#8220;black pipe tests&#8221;: that is, tests of both ends of PyMongo, both its public API and the messages it sends and receives on the network. MockupDB had already proven its merit there. But when it came time to test the C driver\u2014that&#8217;s when MockupDB really rescued me.<\/p>\n<p>First I added basic SSL support to MockupDB, which was easy in Python. Then I wrote a Python script that hung up on the client at the just the wrong moment:<\/p>\n<pre class=\" brush:php\">\r\nfrom mockupdb import MockupDB, Command\r\nserver = MockupDB(port=27017, ssl=True, verbose=True)\r\nserver.run()\r\nserver.autoresponds('isMaster')\r\nserver.autoresponds('ping')\r\nserver.receives('listCollections').hangup()<\/pre>\n<p>The server responds to &#8220;isMaster&#8221; and &#8220;ping&#8221; commands normally, but shuts down the connection when it receives &#8220;listCollections&#8221;. I set &#8220;verbose=True&#8221; so I could watch the conversation.<\/p>\n<p>I connected to it with the C Driver:<\/p>\n<pre class=\" brush:php\">client = mongoc_client_new (\"mongodb:\/\/localhost\/?ssl=true\");\r\n\/* MockupDB won't present a valid cert *\/\r\nssl_options.weak_cert_validation = true;\r\nmongoc_client_set_ssl_opts (client, &amp;ssl_options);\r\ndb = mongoc_client_get_database (client, \"test\");\r\nmongoc_database_get_collection_names (db, &amp;error);<\/pre>\n<p>I compiled this code and ran it in one terminal while I ran the MockupDB server in another. It logged:<\/p>\n<pre class=\" brush:php\">connection from 127.0.0.1:56946\r\n56946   Command({\"isMaster\": 1}, flags=SlaveOkay, namespace=\"admin\")\r\n    56946   &lt;-- OpReply({\"ok\": 1})\r\n    (autoresponse)\r\n56946   Command({\"ping\": 1}, flags=SlaveOkay, namespace=\"admin\")\r\n    56946   &lt;-- OpReply({\"ok\": 1})\r\n    (autoresponse)\r\n56946   Command({\"listCollections\": 1}, flags=SlaveOkay, namespace=\"test\")\r\n    56946   hangup!\r\ndisconnected: 127.0.0.1:56946<\/pre>\n<p>(Back then, the driver called &#8220;isMaster&#8221; and &#8220;ping&#8221; on new connections; in version 1.2 we sped up connections by calling only &#8220;isMaster&#8221;.)<\/p>\n<p>Now that I had a fake MongoDB server that shut down its connection at the worst time, I could test my hypothesis. Indeed, the driver hung until its network timeout. Just to be certain, I turned off TLS on both sides and confirmed that the driver detected the closed connection promptly. If I turned TLS back on, and applied my code fix, the driver now behaved correctly with TLS as well.<\/p>\n<p>I had uploaded a patch for code review in time for dinner, so my girlfriend and I went out in Montr\u00e9al&#8217;s Old Town for duck confit and truffled potatoes.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits.jpg\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-8023\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits-1024x683.jpg\" alt=\"circuits\" width=\"620\" height=\"414\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits-1024x683.jpg 1024w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits-300x200.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/circuits.jpg 1200w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<h2>Cross-Language Testing<\/h2>\n<p>I&#8217;ve used MockupDB to reproduce several other C Driver bugs. One was a variation on the TLS hang\u2014it required the server to hang up at just the wrong moment, but in this case it was in response to an &#8220;aggregate&#8221; command. In another, there was a crash in a very complex unfortunate sequence: the driver had to pause while iterating a cursor, execute another command, detect a replica set election, then resume iterating the cursor. Especially in this latter scenario, to reliably enact the sequence with a real MongoDB server would have been so much trouble I&#8217;d never have automated the test. But simulating the sequence with MockupDB was easy.<\/p>\n<p>MockupDB can test programs in any language, so long as they speak the MongoDB wire protocol. Admittedly it is <em>most<\/em> convenient when it runs in the same Python process as the code under test, as we saw in <a href=\"http:\/\/emptysqua.re\/blog\/black-pipe-testing-pymongo\/\">the previous article<\/a>. But I found it performs admirably testing the C Driver too. I use it now as my tool of first resort, any time I need to simulate an unfortunate sequence of events in a MongoDB deployment.<\/p>\n<p><a href=\"http:\/\/emptysqua.re\/blog\/black-pipe-testing-series\/\">Read the whole series on black pipe testing.<\/a><\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/emptysqua.re\/blog\/mockupdb-test-libmongoc-mongodb-c-driver-python\/\">MockupDB: Testing The MongoDB C Driver With Python<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Jesse Davis at the <a href=\"http:\/\/emptysqua.re\/blog\/\">A. Jesse Jiryu Davis<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is the third article in my series on &#8220;black pipe&#8221; testing. The series describes how to test networked code, like a MongoDB driver. Such code has two distinct public surfaces: one is its API, and the other is its communication over the network. Treating it as a black box tests just one surface, the &hellip;<\/p>\n","protected":false},"author":29,"featured_media":1651,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[57],"class_list":["post-7993","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-mongodb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MockupDB: Testing The MongoDB C Driver With Python - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"This is the third article in my series on &quot;black pipe&quot; testing. The series describes how to test networked code, like a MongoDB driver. Such code has two\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MockupDB: Testing The MongoDB C Driver With Python - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"This is the third article in my series on &quot;black pipe&quot; testing. The series describes how to test networked code, like a MongoDB driver. Such code has two\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-06T10:15:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jesse Davis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/jessejiryudavis\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jesse Davis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/\"},\"author\":{\"name\":\"Jesse Davis\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56\"},\"headline\":\"MockupDB: Testing The MongoDB C Driver With Python\",\"datePublished\":\"2015-11-06T10:15:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/\"},\"wordCount\":944,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"keywords\":[\"MongoDB\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/\",\"name\":\"MockupDB: Testing The MongoDB C Driver With Python - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"datePublished\":\"2015-11-06T10:15:55+00:00\",\"description\":\"This is the third article in my series on \\\"black pipe\\\" testing. The series describes how to test networked code, like a MongoDB driver. Such code has two\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MockupDB: Testing The MongoDB C Driver With Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56\",\"name\":\"Jesse Davis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2db0fdaadd8cd6b86d93e1205e30dd3b43e3c46b91826513ab618934c3db8cf9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2db0fdaadd8cd6b86d93e1205e30dd3b43e3c46b91826513ab618934c3db8cf9?s=96&d=mm&r=g\",\"caption\":\"Jesse Davis\"},\"description\":\"Jesse is a senior engineer at MongoDB in New York City. He specializes in Python, MongoDB drivers, and asynchronous frameworks.\",\"sameAs\":[\"http:\/\/emptysqua.re\/blog\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/jessejiryudavis\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/jesse-davis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MockupDB: Testing The MongoDB C Driver With Python - Web Code Geeks - 2026","description":"This is the third article in my series on \"black pipe\" testing. The series describes how to test networked code, like a MongoDB driver. Such code has two","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/","og_locale":"en_US","og_type":"article","og_title":"MockupDB: Testing The MongoDB C Driver With Python - Web Code Geeks - 2026","og_description":"This is the third article in my series on \"black pipe\" testing. The series describes how to test networked code, like a MongoDB driver. Such code has two","og_url":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-11-06T10:15:55+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","type":"image\/jpeg"}],"author":"Jesse Davis","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/jessejiryudavis","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Jesse Davis","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/"},"author":{"name":"Jesse Davis","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56"},"headline":"MockupDB: Testing The MongoDB C Driver With Python","datePublished":"2015-11-06T10:15:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/"},"wordCount":944,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","keywords":["MongoDB"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/","url":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/","name":"MockupDB: Testing The MongoDB C Driver With Python - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","datePublished":"2015-11-06T10:15:55+00:00","description":"This is the third article in my series on \"black pipe\" testing. The series describes how to test networked code, like a MongoDB driver. Such code has two","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/python\/mockupdb-testing-mongodb-c-driver-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/www.webcodegeeks.com\/category\/python\/"},{"@type":"ListItem","position":3,"name":"MockupDB: Testing The MongoDB C Driver With Python"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56","name":"Jesse Davis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2db0fdaadd8cd6b86d93e1205e30dd3b43e3c46b91826513ab618934c3db8cf9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2db0fdaadd8cd6b86d93e1205e30dd3b43e3c46b91826513ab618934c3db8cf9?s=96&d=mm&r=g","caption":"Jesse Davis"},"description":"Jesse is a senior engineer at MongoDB in New York City. He specializes in Python, MongoDB drivers, and asynchronous frameworks.","sameAs":["http:\/\/emptysqua.re\/blog\/","https:\/\/x.com\/https:\/\/twitter.com\/jessejiryudavis"],"url":"https:\/\/www.webcodegeeks.com\/author\/jesse-davis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/7993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=7993"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/7993\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/1651"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=7993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=7993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=7993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}