kopia lustrzana https://github.com/bellingcat/auto-archiver
				
				
				
			Remove accidental path, yet again.
							rodzic
							
								
									b0756a6a34
								
							
						
					
					
						commit
						71b41dd901
					
				|  | @ -124,11 +124,10 @@ def pytest_runtest_setup(item): | |||
| def unpickle(): | ||||
|     """ | ||||
|     Returns a helper function that unpickles a file | ||||
|     ** gets the file from the test_files directory: tests/data/test_files ** | ||||
|     ** gets the file from the test_files directory: tests/data/ ** | ||||
|     """ | ||||
|     def _unpickle(path): | ||||
|         test_data_dir = os.path.join(os.path.dirname(__file__), "data", "test_files") | ||||
|         with open(os.path.join(test_data_dir, path), "rb") as f: | ||||
|         with open(os.path.join("tests/data", path), "rb") as f: | ||||
|             return pickle.load(f) | ||||
|     return _unpickle | ||||
| 
 | ||||
|  |  | |||
|  | @ -79,8 +79,8 @@ def test_get_metadata_error_handling(mock_run, mock_logger_error, enricher): | |||
| @pytest.mark.skip(reason="Requires ExifTool to be installed. TODO mock") | ||||
| def test_metadata_pickle(enricher, unpickle): | ||||
|     # Uses a pickle of a YouTube short | ||||
|     metadata = unpickle("tests/data/metadata/metadata_enricher_ytshort_input.pickle") | ||||
|     expected = unpickle("tests/data/metadata/metadata_enricher_ytshort_expected.pickle") | ||||
|     metadata = unpickle("metadata_enricher_ytshort_input.pickle") | ||||
|     expected = unpickle("metadata_enricher_ytshort_expected.pickle") | ||||
|     enricher.enrich(metadata) | ||||
|     expected_media = expected.media | ||||
|     actual_media = metadata.media | ||||
|  |  | |||
|  | @ -179,8 +179,8 @@ def test_choose_most_complete(): | |||
| def test_choose_most_complete_from_pickles(unpickle): | ||||
|     # test most complete from pickles before and after an enricher has run | ||||
|     # Only compares length of media, not the actual media | ||||
|     m_before_enriching = unpickle("tests/data/metadata/metadata_enricher_ytshort_input.pickle") | ||||
|     m_after_enriching = unpickle("tests/data/metadata/metadata_enricher_ytshort_expected.pickle") | ||||
|     m_before_enriching = unpickle("metadata_enricher_ytshort_input.pickle") | ||||
|     m_after_enriching = unpickle("metadata_enricher_ytshort_expected.pickle") | ||||
|     # Iterates `for r in results[1:]:` | ||||
|     res = Metadata.choose_most_complete([Metadata(), m_after_enriching, m_before_enriching]) | ||||
|     assert res.media == m_after_enriching.media | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 erinhmclark
						erinhmclark