<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>podhmo</author_name>
  <author_url>https://blog.hatena.ne.jp/podhmo/</author_url>
  <blog_title>podhmo's diary</blog_title>
  <blog_url>https://pod.hatenablog.com/</blog_url>
  <categories>
    <anon>memo</anon>
    <anon>python</anon>
    <anon>mock</anon>
  </categories>
  <description>メソッドを置き換えたmockをもう少しstrictにしてみたい。mockのpatchなどでobjectを置き換える時に属性の存在まではspecやspec_setで対応できるのだけれど。メソッドのsignatureまで含めて置き換え前のものと同じかどうか確認したい。 例えば、存在しない属性へのアクセスはエラーになる(これは期待通り) class Ob: def hello(self, name): return &quot;hello:{}&quot;.format(name) class Tests(unittest.TestCase): def test_attr_missing(self): # 属性無しはO…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpod.hatenablog.com%2Fentry%2F2017%2F12%2F13%2F074105&quot; title=&quot;メソッドを置き換えたmockをもう少しstrictにしてみたい - podhmo&amp;#39;s diary&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-12-13 07:51:47</published>
  <title>メソッドを置き換えたmockをもう少しstrictにしてみたい</title>
  <type>rich</type>
  <url>https://pod.hatenablog.com/entry/2017/12/13/074105</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
