def test_my_open_is_wrap_to_open_with_default_flag_r(self): self.mock_function(open).with_param('another file', 'rb').and_return([]) self.assertEqual([], backlogTree.my_open('another file'))
def test_my_open_is_wrap_to_open(self): fileName = 'another file' flag = 'w+' content = ['contents\n'] self.mock_function(open).with_param(fileName, flag).and_return(content) self.assertEqual(content, backlogTree.my_open(fileName, flag))