'Testing the creation of a vuln to a service'

def test_create_note_to_note_service(self):

    h = self.plugin.createAndAddHost('pepito', 'linux')
    i = self.plugin.createAndAddInterface(h, '1.2.3.4')
    s1 = self.plugin.createAndAddServiceToInterface(h, i, 'unknown', protocol='tcp', ports=['80'])
    s2 = self.plugin.createAndAddServiceToInterface(h, i, 'unknown', protocol='tcp', ports=['443'])
    n = self.plugin.createAndAddNoteToService(h, s1, 'note1', 'desc1')
    n2 = self.plugin.createAndAddNoteToNote(h, s1, n, 'note2', 'desc2')
    self._plugin_controller.last_command_information = self.cmdinfo
    self._plugin_controller.onCommandFinished()
    self._model_controller.processAllPendingActions()
    host = self._model_controller.getHost(h)
    interface = host.getInterface(i)
    service1 = interface.getService(s1)
    service2 = interface.getService(s2)
    note1 = service1.getNote(n)
    self.assertTrue((service1.getNote(n) is not None), "The    note    should    be    the    one    we've    just    create")
    self.assertTrue((len(note1.getNotes()) == 1), 'The    note    should    have    a    nested    note')
