{"id":8542,"date":"2015-11-24T12:15:30","date_gmt":"2015-11-24T10:15:30","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=8542"},"modified":"2015-11-16T19:15:24","modified_gmt":"2015-11-16T17:15:24","slug":"test-mongodb-failure-scenarios-mockupdb","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/","title":{"rendered":"Test MongoDB Failure Scenarios With MockupDB"},"content":{"rendered":"<p>This is the fifth article in <a href=\"http:\/\/emptysqua.re\/blog\/black-pipe-testing-series\/\">my series on &#8220;black pipe&#8221; testing<\/a>. Traditional black box tests work well if your application takes inputs and returns output through one interface: the API. But connected applications have two interfaces: both the API and the messages they send and receive on the network. I call the validation of both ends a black pipe test.<\/p>\n<p>In my previous article <a href=\"http:\/\/emptysqua.re\/blog\/libmongoc-black-pipe-testing-mock-server\/\">I described black pipe testing in pure C<\/a>; now we return to Python.<\/p>\n<p>I implemented a Python tool for black pipe testing called <a href=\"http:\/\/mockupdb.readthedocs.org\/\">MockupDB<\/a>. It is a <a href=\"http:\/\/docs.mongodb.org\/meta-driver\/latest\/legacy\/mongodb-wire-protocol\/\">MongoDB wire protocol<\/a> server, built to subject PyMongo to black pipe tests. But it&#8217;s not only for testing PyMongo\u2014if you develop a MongoDB application, you can use MockupDB too. It easily simulates network errors and server failures, or it can refuse to respond at all. Such antics are nearly impossible to test reliably using a real MongoDB server, but it&#8217;s easy with MockupDB.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/york-street-pipes.jpg\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-8618\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/york-street-pipes-1024x705.jpg\" alt=\"york-street-pipes\" width=\"620\" height=\"427\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/york-street-pipes-1024x705.jpg 1024w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/york-street-pipes-300x207.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/york-street-pipes.jpg 1200w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<h2>Testing Your Own Applications With MockupDB<\/h2>\n<p>Let us say you have a Flask application that uses MongoDB. To make testing convenient, I&#8217;ve wrapped it in a <code>make_app<\/code> function:<\/p>\n<pre class=\" brush:php\">from flask import Flask, make_response\r\nfrom pymongo import MongoClient\r\n\r\ndef make_app(mongodb_uri):\r\n    app = Flask(\"my app\")\r\n    db = MongoClient(mongodb_uri)\r\n\r\n    @app.route(\"\/pages\/&lt;page_name&gt;\")\r\n    def page(page_name):\r\n        doc = db.content.pages.find_one({'name': page_name})\r\n        return make_response(doc['contents'])\r\n\r\n    return app<\/pre>\n<p>The app has one route, which returns a page by name.<\/p>\n<p>It is simple enough to test its fairweather conduct using a real MongoDB server, provisioned with data from a test fixture. But how can we test what happens if, for example, MongoDB shuts down in the middle of the query?<\/p>\n<p>I have cooked up for you a test class that uses MockupDB:<\/p>\n<pre class=\" brush:php\">import unittest\r\n\r\nfrom mockupdb import go, OpQuery, MockupDB\r\n\r\n\r\nclass MockupDBFlaskTest(unittest.TestCase):\r\n    def setUp(self):\r\n        self.server = MockupDB(auto_ismaster=True)\r\n        self.server.run()\r\n        self.app = make_app(self.server.uri).test_client()\r\n\r\n    def tearDown(self):\r\n        self.server.stop()<\/pre>\n<p>(Please, Flask experts, critique me in the comments.)<\/p>\n<p>Let me ensure this contraption works for a normal round trip:<\/p>\n<pre class=\" brush:php\"># Method of MockupDBFlaskTest.\r\ndef test(self):\r\n    future = go(self.app.get, \"\/pages\/my_page_name\")\r\n    request = self.server.receives(OpQuery, name='my_page_name')\r\n    request.reply({\"contents\": \"foo\"})\r\n    http_response = future()\r\n    self.assertEqual(\"foo\",\r\n                     http_response.get_data(as_text=True))<\/pre>\n<p>We use MockupDB&#8217;s function <code>go<\/code> to run Flask on a background thread, just like <a href=\"http:\/\/www.webcodegeeks.com\/python\/testing-pymongo-black-pipe\/\">we ran PyMongo operations on a background thread in an earlier article<\/a>. The <code>go<\/code> function returns a Future, which will be resolved once the background thread completes.<\/p>\n<p>On the foreground thread, we impersonate the database server and have a conversation with the application, speaking the MongoDB wire protocol. MockupDB receives the application&#8217;s query, responds with a document, and that allows Flask to finish its job and create an HTTP response. We assert the response has the expected content.<\/p>\n<p>Now comes the payoff! We close MockupDB&#8217;s connection at just the wrong instant, using its <code>hangup<\/code> method:<\/p>\n<pre class=\" brush:php\">def test_hangup(self):\r\n    future = go(self.app.get, \"\/pages\/my_page_name\")\r\n    request = self.server.receives(OpQuery, name='my_page_name')\r\n    request.hangup()  # Close connection.\r\n    http_response = future()\r\n    self.assertEqual(\"foo\",\r\n                     http_response.get_data(as_text=True))<\/pre>\n<p>The test fails, as you guessed it would:<\/p>\n<pre class=\" brush:php\">FAIL: test_hangup (__main__.MockupDBFlaskTest)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"test.py\", line 43, in test_hangup\r\n    self.assertEqual(\"foo\", http_response.get_data(as_text=True))\r\nAssertionError: 'foo' != '&lt;html&gt;&lt;title&gt;500 Internal Server Error...'<\/pre>\n<p>What would we rather the application do? Let&#8217;s have it respond &#8220;Closed for renovations&#8221; when it can&#8217;t reach the database:<\/p>\n<pre class=\" brush:php\">from pymongo.errors import ConnectionFailure\r\n\r\n@app.route(\"\/pages\/&lt;page_name&gt;\")\r\ndef page(page_name):\r\n    try:\r\n        doc = db.content.pages.find_one({'name': page_name})\r\n    except ConnectionFailure:\r\n        return make_response('Closed for renovations')\r\n    return make_response(doc['contents'])<\/pre>\n<p>Test the new error handling by asserting that &#8220;renovations&#8221; is in the response:<\/p>\n<pre class=\" brush:php\">self.assertIn(\"renovations\",\r\n              http_response.get_data(as_text=True))<\/pre>\n<p>(<a href=\"https:\/\/gist.github.com\/ajdavis\/96e4c64be32fce042f10\">See the complete code here<\/a>.)<\/p>\n<p>And how about your connection applications? Do you continuously test them with network errors? Can you imagine how difficult this would be to test without MockupDB?<\/p>\n<p><a href=\"http:\/\/emptysqua.re\/blog\/black-pipe-testing-series\/\">Read the complete &#8220;black pipe&#8221; series here<\/a>, and stay tuned for next week&#8217;s thrilling conclusion.<\/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\/test-mongodb-failures-mockupdb\/\">Test MongoDB Failure Scenarios With MockupDB<\/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 fifth article in my series on &#8220;black pipe&#8221; testing. Traditional black box tests work well if your application takes inputs and returns output through one interface: the API. But connected applications have two interfaces: both the API and the messages they send and receive on the network. I call the validation of &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":[280,57],"class_list":["post-8542","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-mockupdb","tag-mongodb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Test MongoDB Failure Scenarios With MockupDB - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"This is the fifth article in my series on &quot;black pipe&quot; testing. Traditional black box tests work well if your application takes inputs and returns output\" \/>\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\/test-mongodb-failure-scenarios-mockupdb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Test MongoDB Failure Scenarios With MockupDB - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"This is the fifth article in my series on &quot;black pipe&quot; testing. Traditional black box tests work well if your application takes inputs and returns output\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/\" \/>\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-24T10:15:30+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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/\"},\"author\":{\"name\":\"Jesse Davis\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56\"},\"headline\":\"Test MongoDB Failure Scenarios With MockupDB\",\"datePublished\":\"2015-11-24T10:15:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/\"},\"wordCount\":493,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"keywords\":[\"MockupDB\",\"MongoDB\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/\",\"name\":\"Test MongoDB Failure Scenarios With MockupDB - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"datePublished\":\"2015-11-24T10:15:30+00:00\",\"description\":\"This is the fifth article in my series on \\\"black pipe\\\" testing. Traditional black box tests work well if your application takes inputs and returns output\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#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\/test-mongodb-failure-scenarios-mockupdb\/#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\":\"Test MongoDB Failure Scenarios With MockupDB\"}]},{\"@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":"Test MongoDB Failure Scenarios With MockupDB - Web Code Geeks - 2026","description":"This is the fifth article in my series on \"black pipe\" testing. Traditional black box tests work well if your application takes inputs and returns output","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\/test-mongodb-failure-scenarios-mockupdb\/","og_locale":"en_US","og_type":"article","og_title":"Test MongoDB Failure Scenarios With MockupDB - Web Code Geeks - 2026","og_description":"This is the fifth article in my series on \"black pipe\" testing. Traditional black box tests work well if your application takes inputs and returns output","og_url":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-11-24T10:15:30+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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/"},"author":{"name":"Jesse Davis","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56"},"headline":"Test MongoDB Failure Scenarios With MockupDB","datePublished":"2015-11-24T10:15:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/"},"wordCount":493,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","keywords":["MockupDB","MongoDB"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/","url":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/","name":"Test MongoDB Failure Scenarios With MockupDB - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","datePublished":"2015-11-24T10:15:30+00:00","description":"This is the fifth article in my series on \"black pipe\" testing. Traditional black box tests work well if your application takes inputs and returns output","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/python\/test-mongodb-failure-scenarios-mockupdb\/#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\/test-mongodb-failure-scenarios-mockupdb\/#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":"Test MongoDB Failure Scenarios With MockupDB"}]},{"@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\/8542","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=8542"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/8542\/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=8542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=8542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=8542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}