コード例 #1
0
 def test_load_from_vtreader_0_apply_styles(self, mock_style, mock_critical,
                                            mock_info):
     global iface
     clear_cache()
     QgsProject.instance().removeAllMapLayers()
     self._load(iface=iface, max_tiles=1, apply_styles=True)
     print(mock_info.call_args_list)
     print(mock_critical.call_args_list)
     # print mock_style.assert_called_with()
     mock_info.assert_any_call("Import complete")
コード例 #2
0
 def test_load_from_vtreader_6_merge_python_decoded_tiles(
         self, mock_load_lib, mock_critical, mock_info):
     global iface
     clear_cache()
     self._load(iface=iface, max_tiles=2, merge_tiles=True)
     print(mock_info.call_args_list)
     print(mock_critical.call_args_list)
     mock_info.assert_any_call("Native decoding not supported. ({}, {}bit)",
                               "Linux", "64")
     mock_info.assert_any_call("Import complete")
コード例 #3
0
 def test_load_from_vtreader_5_clip_native_decoded_tiles(
         self, mock_critical, mock_info):
     global iface
     clear_cache()
     self._load(iface=iface, max_tiles=2, clip_tiles=True)
     print(mock_info.call_args_list)
     print(mock_critical.call_args_list)
     mock_info.assert_any_call("Native decoding supported!!! ({}, {}bit)",
                               "Linux", "64")
     mock_info.assert_any_call("Import complete")
コード例 #4
0
 def test_load_from_vtreader_2(self, mphelper_mock_info, mock_info):
     global iface
     clear_cache()
     QgsProject.instance().removeAllMapLayers()
     self._load(iface=iface, max_tiles=1)
     print(mock_info.call_args_list)
     print(mphelper_mock_info.call_args_list)
     mock_info.assert_any_call("Native decoding supported!!! ({}, {}bit)",
                               "Linux", "64")
     mock_info.assert_any_call("Decoding finished, {} tiles with data", 1)
     mock_info.assert_any_call("Import complete")
コード例 #5
0
    def test_load_from_vtreader_1_multiprocessed(self, mock_qgis, mock_info):
        global iface
        QgsProject.instance().removeAllMapLayers()
        clear_cache()

        self._load(iface=iface, max_tiles=2, serial_tile_processing_limit=1)

        print(mock_info.call_args_list)
        mock_info.assert_any_call("Native decoding supported!!! ({}, {}bit)",
                                  "Linux", "64")
        mock_info.assert_any_call("Processing tiles in parallel...")
        mock_info.assert_any_call("Decoding finished, {} tiles with data", 2)
        mock_info.assert_any_call("Import complete")
コード例 #6
0
    def test_load_from_vtreader_0_python_processing(self, mock_qgis,
                                                    mock_load_lib, mock_info):
        global iface
        QgsProject.instance().removeAllMapLayers()
        clear_cache()

        self._load(iface=iface, max_tiles=1)

        print("calls: ", mock_info.call_args_list)
        mock_info.assert_any_call("Native decoding not supported. ({}, {}bit)",
                                  "Linux", "64")
        mock_info.assert_any_call("Decoding finished, {} tiles with data", 1)
        mock_info.assert_any_call("Import complete")
コード例 #7
0
    def test_load_from_vtreader_7_clip_python_decoded_tiles(
            self, mock_load_lib, mock_critical, mock_info):
        global iface
        clear_cache()

        # def wait_for_singal(reader: VtReader):
        #     return QSignalSpy(reader.ready_for_next_loading_step)

        self._load(iface=iface, max_tiles=2, clip_tiles=True)
        # print("Spy isValid:", spy.isValid())
        # print("Spy wait return value: {}".format(spy.wait(timeout=15000)))
        print(mock_info.call_args_list)
        print(mock_critical.call_args_list)
        mock_info.assert_any_call("Native decoding not supported. ({}, {}bit)",
                                  "Linux", "64")
        mock_info.assert_any_call("Import complete")