Esempio n. 1
0
    def test_get_source_subdir_data(self, mock_handle_ignored_file_type):
        """
        Test 'get_source_subdir_data' populates 'src_dir_fls' with collected
        data.
        """
        mock_handle_ignored_file_type.side_effect = [
            None,
            IgnoredTypeException,
            None,
        ]
        src_subdir_files = ["song.mp3", "cover.jpg", "demo.mp3"]

        sync = Sync(FAKE_MTP_DETAILS, "/tmp", "Card/Music")
        sync.set_source_abs()
        sync.set_destination_abs()
        sync_data = self._create_empty_sync_data(sync)
        sync.get_source_subdir_data(src_subdir_files, sync_data)

        self.assertEqual(
            sync_data["src_dir_fls"],
            ["/tmp/testdir/song.mp3", "/tmp/testdir/demo.mp3"],
        )