def test_restores_original_value(self): original_value = doubles.testing.User patch('doubles.testing.User', 'Bob Barker') teardown() assert original_value == doubles.testing.User
def test_patch_non_existent_object(self): with pytest.raises(VerifyingDoubleError): patch('doubles.testing.NotReal', True)
def test_creating_instance_double_after_patching(self): patch('doubles.testing.User', InstanceDouble('doubles.testing.User')) assert InstanceDouble('doubles.testing.User')
def test_patch_wth_new_object_supplied(self): patch('doubles.testing.User', 'Bob Barker') assert doubles.testing.User == 'Bob Barker'