def testStuboutMethodWithSmartSet(self):
     non_existing_path = 'non_existing_path'
     self.stubber.smart_set(os.path, 'exists', lambda x: True)
     self.assertTrue(
         mox3_stubout_example.check_if_exists(non_existing_path))
     self.stubber.smart_unset_all()
     self.assertFalse(
         mox3_stubout_example.check_if_exists(non_existing_path))
 def testStuboutSubModuleWithSmartSet(self):
     # this one does not work with Set
     non_existing_path = 'non_existing_path'
     self.assertFalse(
         mox3_stubout_example.check_if_exists(non_existing_path))
     self.stubber.smart_set(os, 'path', ExistingPath)
     self.assertTrue(
         mox3_stubout_example.check_if_exists(non_existing_path))
     self.stubber.smart_unset_all()
     self.assertFalse(
         mox3_stubout_example.check_if_exists(non_existing_path))