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
classTestOs:
deftest_getcwd(self):
withstubout(os, "getcwd") asm_getcwd:
m_getcwd().returns("/mox/path")
# the second call will return a different valuem_getcwd().returns("/mox/another/path")
# the three subsequent calls will return "/"# if no argument is passed, multiple_times doesn't limit the number of callsm_getcwd().multiple_times(3).returns("/")
assertos.getcwd() =="/mox/path"assertos.getcwd() =="/mox/another/path"os.getcwd()
mox.verify(m_getcwd)
multipe_times need to be able to receive an argument (in the example above: 3), so we expect only three calls. The test above should fail unless we add two new calls to os.getcwd()
The text was updated successfully, but these errors were encountered:
multipe_times
need to be able to receive an argument (in the example above: 3), so we expect only three calls. The test above should fail unless we add two new calls toos.getcwd()
The text was updated successfully, but these errors were encountered: