'Test the _write_defined_names() method'

def test_write_defined_names_1(self):

    self.workbook.defined_names = [['_xlnm.Print_Titles', 0, 'Sheet1!$1:$1', 0]]
    self.workbook._write_defined_names()
    exp = '<definedNames><definedName    name="_xlnm.Print_Titles"    localSheetId="0">Sheet1!$1:$1</definedName></definedNames>'
    got = self.fh.getvalue()
    self.assertEqual(got, exp)
