def assert_obtains_and_saves_file(self, func, file_path, directory):
        file = mock.Mock()
        file.name = 'file_name'
        self.conn.get_file.return_value = file

        saved_file_path = func(directory)

        self.conn.get_file.assert_called_once_with(file_path)
        directory = directory or os.getcwd()
        ref_saved_file_path = os.path.join(directory, 'file_name')
        self.open.assert_called_once_with(
            ref_saved_file_path,
            'wb'
        )
        self.assertEqual(ref_saved_file_path, saved_file_path)
Asserts that ``func(directory)`` obtains the given file and saves it
dataset/ETHPy150Open s3rvac/retdec-python/tests/resource_tests.py/WithMockedIO.assert_obtains_and_saves_file