@@ 72-90 (lines=19) @@ | ||
69 | ||
70 | assert db_row == 'foobar', db_row |
|
71 | ||
72 | @mock.patch('elodie.config.config_file', '%s/config.ini-googlephotos-after-unsupported' % gettempdir()) |
|
73 | def test_googlephotos_after_unsupported(): |
|
74 | with open('%s/config.ini-googlephotos-after-unsupported' % gettempdir(), 'w') as f: |
|
75 | f.write(config_string_fmt) |
|
76 | if hasattr(load_config, 'config'): |
|
77 | del load_config.config |
|
78 | ||
79 | final_file_path = helper.get_file('audio.m4a') |
|
80 | sample_photo = Audio(final_file_path) |
|
81 | sample_metadata = sample_photo.get_metadata() |
|
82 | sample_metadata['original_name'] = 'foobar' |
|
83 | gp = GooglePhotos() |
|
84 | gp.after('', '', final_file_path, sample_metadata) |
|
85 | db_row = gp.db.get(final_file_path) |
|
86 | ||
87 | if hasattr(load_config, 'config'): |
|
88 | del load_config.config |
|
89 | ||
90 | assert db_row == None, db_row |
|
91 | ||
92 | @mock.patch('elodie.config.config_file', '%s/config.ini-googlephotos-upload' % gettempdir()) |
|
93 | def test_googlephotos_upload(): |
|
@@ 52-70 (lines=19) @@ | ||
49 | gp.set_session() |
|
50 | assert gp.session is not None, gp.session |
|
51 | ||
52 | @mock.patch('elodie.config.config_file', '%s/config.ini-googlephotos-after-supported' % gettempdir()) |
|
53 | def test_googlephotos_after_supported(): |
|
54 | with open('%s/config.ini-googlephotos-after-supported' % gettempdir(), 'w') as f: |
|
55 | f.write(config_string_fmt) |
|
56 | if hasattr(load_config, 'config'): |
|
57 | del load_config.config |
|
58 | ||
59 | sample_photo = Photo(helper.get_file('plain.jpg')) |
|
60 | sample_metadata = sample_photo.get_metadata() |
|
61 | sample_metadata['original_name'] = 'foobar' |
|
62 | final_file_path = helper.get_file('plain.jpg') |
|
63 | gp = GooglePhotos() |
|
64 | gp.after('', '', final_file_path, sample_metadata) |
|
65 | db_row = gp.db.get(final_file_path) |
|
66 | ||
67 | if hasattr(load_config, 'config'): |
|
68 | del load_config.config |
|
69 | ||
70 | assert db_row == 'foobar', db_row |
|
71 | ||
72 | @mock.patch('elodie.config.config_file', '%s/config.ini-googlephotos-after-unsupported' % gettempdir()) |
|
73 | def test_googlephotos_after_unsupported(): |