def test_notify_destination(self): self.toolbox.msg = MagicMock() self.toolbox.msg.attach_mock(MagicMock(), "emit") self.toolbox.msg_warning = MagicMock() self.toolbox.msg_warning.attach_mock(MagicMock(), "emit") source_item = NonCallableMagicMock() source_item.name = "source name" source_item.item_type = MagicMock(return_value="Data Connection") self.importer.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with( "Link established. You can define mappings on data from <b>source name</b> using item <b>importer</b>." ) source_item.item_type = MagicMock(return_value="Data Store") self.importer.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with("Link established.") source_item.item_type = MagicMock(return_value="Exporter") self.importer.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a " "<b>Exporter</b> and a <b>Importer</b> has not been implemented yet." ) source_item.item_type = MagicMock(return_value="Tool") self.importer.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with( "Link established." " You can define mappings on output files from <b>source name</b> using item <b>importer</b>." ) source_item.item_type = MagicMock(return_value="View") self.importer.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a " "<b>View</b> and a <b>Importer</b> has not been implemented yet.")
def test_notify_destination(self): self.toolbox.msg = MagicMock() self.toolbox.msg.attach_mock(MagicMock(), "emit") self.toolbox.msg_warning = MagicMock() self.toolbox.msg_warning.attach_mock(MagicMock(), "emit") source_item = NonCallableMagicMock() source_item.name = "source name" source_item.item_type = MagicMock(return_value="Data Connection") self.view.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a <b>Data Connection</b> and" " a <b>View</b> has not been implemented yet.") source_item.item_type = MagicMock(return_value="Importer") self.view.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a <b>Importer</b> and a <b>View</b> has not been implemented yet." ) source_item.item_type = MagicMock(return_value="Data Store") self.view.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with( "Link established. You can visualize Data Store <b>source name</b> in View <b>V</b>." ) source_item.item_type = MagicMock(return_value="Exporter") self.view.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a <b>Exporter</b> and a <b>View</b> has not been implemented yet." ) source_item.item_type = MagicMock(return_value="Tool") self.view.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with( "Link established. You can visualize the ouput from Tool <b>source name</b> in View <b>V</b>." )
def test_notify_destination(self): self.toolbox.msg = MagicMock() self.toolbox.msg.attach_mock(MagicMock(), "emit") self.toolbox.msg_warning = MagicMock() self.toolbox.msg_warning.attach_mock(MagicMock(), "emit") source_item = NonCallableMagicMock() source_item.name = "source name" source_item.item_type = MagicMock(return_value="Importer") self.data_connection.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with("Link established.") source_item.item_type = MagicMock(return_value="Data Store") self.data_connection.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with("Link established.") source_item.item_type = MagicMock(return_value="Exporter") self.data_connection.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a <b>Exporter</b> and" " a <b>Data Connection</b> has not been implemented yet.") source_item.item_type = MagicMock(return_value="Tool") self.data_connection.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with( "Link established. Tool <b>source name</b> output files" " will be passed as references to item <b>DC</b> after execution.") source_item.item_type = MagicMock(return_value="View") self.data_connection.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a <b>View</b> and" " a <b>Data Connection</b> has not been implemented yet.")
def test_notify_destination(self): self.toolbox.msg = MagicMock() self.toolbox.msg.attach_mock(MagicMock(), "emit") self.toolbox.msg_warning = MagicMock() self.toolbox.msg_warning.attach_mock(MagicMock(), "emit") source_item = NonCallableMagicMock() source_item.name = "source name" source_item.item_type = MagicMock(return_value="Data Connection") self.exporter.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a " "<b>Data Connection</b> and a <b>Exporter</b> has not been implemented yet." ) source_item.item_type = MagicMock(return_value="Importer") self.exporter.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a " "<b>Importer</b> and a <b>Exporter</b> has not been implemented yet." ) source_item.item_type = MagicMock(return_value="Data Store") self.exporter.notify_destination(source_item) self.toolbox.msg.emit.assert_called_with( "Link established. Data Store <b>source name</b> will be " "exported to a .gdx file by <b>exporter</b> when executing.") source_item.item_type = MagicMock(return_value="Tool") self.exporter.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a " "<b>Tool</b> and a <b>Exporter</b> has not been implemented yet.") source_item.item_type = MagicMock(return_value="View") self.exporter.notify_destination(source_item) self.toolbox.msg_warning.emit.assert_called_with( "Link established. Interaction between a " "<b>View</b> and a <b>Exporter</b> has not been implemented yet.")