input: Write a function to generate an HTML table displaying information about the top 10 bestselling books in a specific genre from a given SQLite database. The function should connect to the database, retrieve the relevant data, and then format it into an HTML table. The table should have columns for the title, author, genre, and sales. If no books are found in the specified genre, the function should return an empty string.
  assert generate_html_table('Fantasy') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Book1</td><td>Author1</td><td>Fantasy</td><td>1000</td></tr><tr><td>Book2</td><td>Author2</td><td>Fantasy</td><td>900</td></tr></table>'
  assert generate_html_table('Science Fiction') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Book3</td><td>Author3</td><td>Science Fiction</td><td>800</td></tr><tr><td>Book4</td><td>Author4</td><td>Science Fiction</td><td>700</td></tr></table>'
  assert generate_html_table('Mystery') == ''
  assert generate_html_table('Romance') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Book5</td><td>Author5</td><td>Romance</td><td>600</td></tr></table>'
output: 
  def generate_html_table(genre):
      import sqlite3
      conn = sqlite3.connect('books.db')
      cursor = conn.cursor()
      cursor.execute("SELECT title, author, genre, sales FROM books WHERE genre=? ORDER BY sales DESC LIMIT 10", (genre,))
      rows = cursor.fetchall()
      conn.close()
      
      if not rows:
          return ''
      
      html = '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr>'
      for row in rows:
          html += f'<tr><td>{row[0]}</td><td>{row[1]}</td><td>{row[2]}</td><td>{row[3]}</td></tr>'
      html += '</table>'
      return html
  