def execute(self, format_code): sql = "SELECT Code, MimeType FROM Format WHERE Code=?" r = self.__connection.execute_sql_fetch_all_with_params(sql, (format_code,)) if len(r) > 0: bt = BookType() bt.Format = r[0][0] bt.MimeType = r[0][1] return bt
def test_add_book_type_calls_correct_collaborating_objects(self): bt = BookType() bt.Format = "EPUB" bt.MimeType = "MIME" self.__target.execute(bt) self.assertEquals(1, self.__connection.fetch_none_with_params_calls)