示例#1
0
def test_get_existing_clusters_info__gives_the_same_dataframe_cols():
    config_1 = get_development_config()
    config_1.watch_folders = []
    df_blank, _, _ = get_existing_clusters_info(config_1)

    config_2 = get_development_config()
    config_2.watch_folders = ["zdjecia", "clusters"]
    config_2.force_deep_scan = True
    config_2.assign_to_clusters_existing_in_libs = True
    df_clusters, _, _ = get_existing_clusters_info(config_2)

    cols_blank = df_blank.columns
    cols = df_clusters.columns
    assert check_lists_equal(
        cols, cols_blank), f"clusters:{cols}, blank:{cols_blank}"
示例#2
0
def test_get_existing_clusters_info__ids_are_uniq():
    config = get_development_config()
    config.watch_folders = ["zdjecia", "clusters"]
    config.force_deep_scan = True
    config.assign_to_clusters_existing_in_libs = True
    df_clusters, _, _ = get_existing_clusters_info(config)

    ids = df_clusters.cluster_id.values

    ids_are_unique = len(ids) == len(set(ids))
    assert ids_are_unique
示例#3
0
def test_multiple_timestamps_to_one():
    config = get_development_config()
    image_reader = ImageReader(config)
    row_list = image_reader.get_data_from_files_as_list_of_rows()
    inbox_media_df_in = MediaDataFrame(pd.DataFrame(row_list))
    sel_cols = ["file_name", "m_date", "c_date", "exif_date", "date"]

    inbox_media_df_out = multiple_timestamps_to_one(inbox_media_df_in.copy(),
                                                    drop_columns=False)
    sel_cols_out = ["file_name", "date"]

    # keep only most important results for analysis in testing
    inbox_media_df_out = inbox_media_df_out[sel_cols]
    pass
示例#4
0
 def setup_class(self):
     self.config = get_development_config()
     self.config.in_dir_name = TEST_INBOX_DIR
示例#5
0
def test_get_files_from_watch_folder():
    config = get_development_config()
    watch_folder = config.watch_folders[0]
    f_list = get_files_from_folder(watch_folder)
    assert len(list(f_list)) > 0
def test_image_grouper__instantinates_for_dev_config():
    config = get_development_config()
    img_groupper = ImageGrouper(config)
    assert isinstance(img_groupper, ImageGrouper)
 def setup_class(self):
     self.config = get_development_config()
     self.config.assign_to_clusters_existing_in_libs = True
def test_get_development_config__runs():
    get_development_config()