You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Value():
def create(self):
self.volume=do_func()
def remove(self):
self.volume.remove()
mock Test:
class TestValue(unittest.Testcase):
@mock.patch("docker.client.DockerClient","remove",new_callable=PropertyMock())
def test_remove(self,docker_remove):
vol_obj=Value()
vol_obj.remove()
Output:
testtools.testresult.real._StringException: Traceback (most recent call last):
File "/usr/lib/python3.6/unittest/mock.py", line 1179, in patched
return func(*args, **keywargs)
File "/tmp/tox_env/collie/tests/volumes/test_base.py", line 36, in test_remove
vol_obj.remove()
File "/tmp/tox_env/collie/volumes/base.py", line 25, in remove
self.volume.remove(force=True)
AttributeError: 'DockerVolume' object has no attribute 'volume'
The text was updated successfully, but these errors were encountered:
class Value():
def create(self):
self.volume=do_func()
def remove(self):
self.volume.remove()
mock Test:
class TestValue(unittest.Testcase):
@mock.patch("docker.client.DockerClient","remove",new_callable=PropertyMock())
def test_remove(self,docker_remove):
vol_obj=Value()
vol_obj.remove()
Output:
testtools.testresult.real._StringException: Traceback (most recent call last):
File "/usr/lib/python3.6/unittest/mock.py", line 1179, in patched
return func(*args, **keywargs)
File "/tmp/tox_env/collie/tests/volumes/test_base.py", line 36, in test_remove
vol_obj.remove()
File "/tmp/tox_env/collie/volumes/base.py", line 25, in remove
self.volume.remove(force=True)
AttributeError: 'DockerVolume' object has no attribute 'volume'
The text was updated successfully, but these errors were encountered: