| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | module | method | test name | test description | test init | input | expected output | |||||||||||||||||||
2 | s3 | list_files_in_prefix | test_list_files_in_prefix_ok | Tests the list_files_in_prefix method for getting the 2 file keys as list on the mocked s3 bucket | Mock s3 bucket Upload 2 files to the bucket with the prefix Create S3BucketConnector test instance | prefix | list containing the 2 file names | |||||||||||||||||||
3 | test_list_files_in_prefix_wrong_prefix | Tests the list_files_in_prefix method in case of a wrong or not existing prefix | Mock s3 bucket Upload 2 files to the bucket with the prefix Create S3BucketConnector test instance | wrong prefix | empty list | |||||||||||||||||||||
4 | read_csv_as_df | test_read_csv_as_df_ok | Tests the read_csv_as_df method for reading 1 .csv file from the mocked s3 bucket | Mock s3 bucket Upload 1 csv file to the bucket Create S3BucketConnector test instance | filename | DataFrame with csv file content | ||||||||||||||||||||
5 | write_df_to_s3 | test_write_df_to_s3_empty | Tests the write_df_to_s3 method with an empty DataFrame as input | Mock s3 bucket Create S3BucketConnector test instance | empty DataFrame | None | ||||||||||||||||||||
6 | test_write_df_to_s3_csv | Tests the write_df_to_s3 method if writing csv is successful | Mock s3 bucket Create S3BucketConnector test instance | DataFrame + format = "csv" | DataFrame as csv on mocked s3 | |||||||||||||||||||||
7 | test_write_df_to_s3_parquet | Tests the write_df_to_s3 method if writing parquet is successful | Mock s3 bucket Create S3BucketConnector test instance | DataFrame + format = "parquet" | DataFrame as parquet on mocked s3 | |||||||||||||||||||||
8 | test_write_df_to_s3_wrong_format | Tests the write_df_to_s3 method if a not supported format is given as argument | Mock s3 bucket Create S3BucketConnector test instance | DataFrame + wrong format | WrongFormatException | |||||||||||||||||||||
9 | meta_process | update_meta_file | test_update_meta_file_no_meta_file | Tests the update_meta_file method when there is no meta file | Mock s3 bucket Create S3BucketConnector test instance | date_list, meta_key, S3BucketConnector with mocked s3 | meta file created containing the date_list | |||||||||||||||||||
10 | test_update_meta_file_empty_date_list | Tests the update_meta_file method when the argument extract_date_list is empty | Mock s3 bucket Create S3BucketConnector test instance | empty date_list, meta_key, S3BucketConnector with mocked s3 | No meta file, log "The dataframe is empty" | |||||||||||||||||||||
11 | test_update_meta_file_meta_file_ok | Tests the update_meta_file method when there already a meta file | Mock s3 bucket Create S3BucketConnector test instance Upload meta file with correct format | date_list, meta_key, S3BucketConnector with mocked s3 | new meta file with concatenated dates | |||||||||||||||||||||
12 | test_update_meta_file_meta_file_wrong | Tests the update_meta_file method when there is a wrong meta file | Mock s3 bucket Create S3BucketConnector test instance Upload meta file with wrong format | date_list, meta_key, S3BucketConnector with mocked s3 | WrongMetaFileException | |||||||||||||||||||||
13 | return_date_list | test_return_date_list_no_meta_file | Tests the return_date_list method when there is no meta file | Mock s3 bucket Create S3BucketConnector test instance | first_date, meta_key, S3BucketConnector with mocked s3 | min_date == first_date, date_list from first_date - 1 untill today | ||||||||||||||||||||
14 | test_return_date_list_meta_file_ok | Tests the return_date_list method when there is a meta file | Mock s3 bucket Create S3BucketConnector test instance Upload correct meta file | different cases of first_date, meta_key, S3BucketConnector with mocked s3 | min_date and date_list according to different inits/inputs | |||||||||||||||||||||
15 | test_return_date_list_meta_file_wrong | Tests the return_date_list method when there is a wrong meta file -> to show how pandas handles it | Mock s3 bucket Create S3BucketConnector test instance Upload meta file with wrong format | first_date, meta_key, S3BucketConnector with mocked s3 | KeyError | |||||||||||||||||||||
16 | test_return_date_list_empty_date_list | Tests the return_date_list method when there are no dates to be returned | Mock s3 bucket Create S3BucketConnector test instance Upload correct meta file | first_date that there will be no dates to be processed, meta_key, S3BucketConnector with mocked s3 | min_date = '2200-01-01', empty date_list | |||||||||||||||||||||
17 | xetra_transformer | extract | test_extract_no_files | Tests the extract method when there are no files to be extracted | Mock s3 bucket Create S3BucketConnector test instance Create XetraETL test instance patching method return_date_list returning an empty list | - | empty DataFrame | |||||||||||||||||||
18 | test_extract_files | Tests the extract method when there are files to be extracted | Mock s3 bucket Create S3BucketConnector test instance Create XetraETL test instance patching method return_date_list returning a date list | - | extracting the dates according to the date list | |||||||||||||||||||||
19 | transform_report1 | test_transform_report1_emptydf | Tests the transform_report1 method with an empty DataFrame as input argument | Create XetraETL test instance patching method return_date_list | empty DataFrame | empty DataFrame | ||||||||||||||||||||
20 | test_transform_report1_ok | Tests the transform_report1 method with an DataFrame as input argument | Create XetraETL test instance patching method return_date_list | DataFrame | expected DataFrame | |||||||||||||||||||||
21 | load | test_load | Tests the load method | Mock s3 bucket Create XetraETL test instance patching method return_date_list | DataFrame | .parquet file on mocket s3 with the DataFrame content | ||||||||||||||||||||
22 | etl_report1 | test_etl_report1 | Tests the etl_report1 method | Mock s3 bucket Upload source data Create XetraETL test instance patching method return_date_list | - | .parquet file on mocket s3 with the source data content in report 1 format | ||||||||||||||||||||
23 | ||||||||||||||||||||||||||
24 | ||||||||||||||||||||||||||
25 | ||||||||||||||||||||||||||
26 | ||||||||||||||||||||||||||
27 | ||||||||||||||||||||||||||
28 | ||||||||||||||||||||||||||
29 | ||||||||||||||||||||||||||
30 | ||||||||||||||||||||||||||
31 | ||||||||||||||||||||||||||
32 | ||||||||||||||||||||||||||
33 | ||||||||||||||||||||||||||
34 | ||||||||||||||||||||||||||
35 | ||||||||||||||||||||||||||
36 | ||||||||||||||||||||||||||
37 | ||||||||||||||||||||||||||
38 | ||||||||||||||||||||||||||
39 | ||||||||||||||||||||||||||
40 | ||||||||||||||||||||||||||
41 | ||||||||||||||||||||||||||
42 | ||||||||||||||||||||||||||
43 | ||||||||||||||||||||||||||
44 | ||||||||||||||||||||||||||
45 | ||||||||||||||||||||||||||
46 | ||||||||||||||||||||||||||
47 | ||||||||||||||||||||||||||
48 | ||||||||||||||||||||||||||
49 | ||||||||||||||||||||||||||
50 | ||||||||||||||||||||||||||
51 | ||||||||||||||||||||||||||
52 | ||||||||||||||||||||||||||
53 | ||||||||||||||||||||||||||
54 | ||||||||||||||||||||||||||
55 | ||||||||||||||||||||||||||
56 | ||||||||||||||||||||||||||
57 | ||||||||||||||||||||||||||
58 | ||||||||||||||||||||||||||
59 | ||||||||||||||||||||||||||
60 | ||||||||||||||||||||||||||
61 | ||||||||||||||||||||||||||
62 | ||||||||||||||||||||||||||
63 | ||||||||||||||||||||||||||
64 | ||||||||||||||||||||||||||
65 | ||||||||||||||||||||||||||
66 | ||||||||||||||||||||||||||
67 | ||||||||||||||||||||||||||
68 | ||||||||||||||||||||||||||
69 | ||||||||||||||||||||||||||
70 | ||||||||||||||||||||||||||
71 | ||||||||||||||||||||||||||
72 | ||||||||||||||||||||||||||
73 | ||||||||||||||||||||||||||
74 | ||||||||||||||||||||||||||
75 | ||||||||||||||||||||||||||
76 | ||||||||||||||||||||||||||
77 | ||||||||||||||||||||||||||
78 | ||||||||||||||||||||||||||
79 | ||||||||||||||||||||||||||
80 | ||||||||||||||||||||||||||
81 | ||||||||||||||||||||||||||
82 | ||||||||||||||||||||||||||
83 | ||||||||||||||||||||||||||
84 | ||||||||||||||||||||||||||
85 | ||||||||||||||||||||||||||
86 | ||||||||||||||||||||||||||
87 | ||||||||||||||||||||||||||
88 | ||||||||||||||||||||||||||
89 | ||||||||||||||||||||||||||
90 | ||||||||||||||||||||||||||
91 | ||||||||||||||||||||||||||
92 | ||||||||||||||||||||||||||
93 | ||||||||||||||||||||||||||
94 | ||||||||||||||||||||||||||
95 | ||||||||||||||||||||||||||
96 | ||||||||||||||||||||||||||
97 | ||||||||||||||||||||||||||
98 | ||||||||||||||||||||||||||
99 | ||||||||||||||||||||||||||
100 |