from rembed import response

from hamcrest import *
import pytest

def test_should_load_from_dictionary():
    dict = {'title' : 'Bees'}
    oembed_response = response.OEmbedResponse(dict)

    assert_that(oembed_response.title, equal_to('Bees'))

def test_response_should_be_immutable():
    dict = {'title' : 'Bees'}
    oembed_response = response.OEmbedResponse(dict)

    with pytest.raises(TypeError):
        oembed_response.title = 'Wasps'
from rembed import response

from hamcrest import *
import pytest

def test_should_load_from_dictionary():
    dict = {'type' : 'link', 'version' : '1.0'}
    oembed_response = response.OEmbedResponse(dict)

    assert_that(oembed_response.type, equal_to('link'))

def test_response_should_be_immutable():
    dict = {'type' : 'link', 'version' : '1.0'}
    oembed_response = response.OEmbedResponse(dict)

    with pytest.raises(TypeError):
        oembed_response.type = 'photo'
Make test match spec more closely
Make test match spec more closely

  from rembed import response
  
  from hamcrest import *
  import pytest
  
  def test_should_load_from_dictionary():
-     dict = {'title' : 'Bees'}
+     dict = {'type' : 'link', 'version' : '1.0'}
      oembed_response = response.OEmbedResponse(dict)
  
-     assert_that(oembed_response.title, equal_to('Bees'))
+     assert_that(oembed_response.type, equal_to('link'))
  
  def test_response_should_be_immutable():
-     dict = {'title' : 'Bees'}
+     dict = {'type' : 'link', 'version' : '1.0'}
      oembed_response = response.OEmbedResponse(dict)
  
      with pytest.raises(TypeError):
-         oembed_response.title = 'Wasps'
+         oembed_response.type = 'photo'
Make test match spec more closely
## Code Before:
from rembed import response

from hamcrest import *
import pytest

def test_should_load_from_dictionary():
    dict = {'title' : 'Bees'}
    oembed_response = response.OEmbedResponse(dict)

    assert_that(oembed_response.title, equal_to('Bees'))

def test_response_should_be_immutable():
    dict = {'title' : 'Bees'}
    oembed_response = response.OEmbedResponse(dict)

    with pytest.raises(TypeError):
        oembed_response.title = 'Wasps'
## Instruction:
Make test match spec more closely
## Code After:
from rembed import response

from hamcrest import *
import pytest

def test_should_load_from_dictionary():
    dict = {'type' : 'link', 'version' : '1.0'}
    oembed_response = response.OEmbedResponse(dict)

    assert_that(oembed_response.type, equal_to('link'))

def test_response_should_be_immutable():
    dict = {'type' : 'link', 'version' : '1.0'}
    oembed_response = response.OEmbedResponse(dict)

    with pytest.raises(TypeError):
        oembed_response.type = 'photo'