@@ 90-105 (lines=16) @@ | ||
87 | ||
88 | assert db_row == None, db_row |
|
89 | ||
90 | @mock.patch('elodie.config.config_file', '%s/config.ini-googlephotos-upload' % gettempdir()) |
|
91 | def test_googlephotos_upload(): |
|
92 | with open('%s/config.ini-googlephotos-upload' % gettempdir(), 'w') as f: |
|
93 | f.write(config_string_fmt) |
|
94 | if hasattr(load_config, 'config'): |
|
95 | del load_config.config |
|
96 | ||
97 | gp = GooglePhotos() |
|
98 | ||
99 | if hasattr(load_config, 'config'): |
|
100 | del load_config.config |
|
101 | ||
102 | gp.set_session() |
|
103 | status = gp.upload(helper.get_file('plain.jpg')) |
|
104 | ||
105 | assert status is not None, status |
|
106 | ||
107 | @mock.patch('elodie.config.config_file', '%s/config.ini-googlephotos-upload-session-fail' % gettempdir()) |
|
108 | def test_googlephotos_upload_session_fail(): |
|
@@ 124-139 (lines=16) @@ | ||
121 | ||
122 | assert status is None, status |
|
123 | ||
124 | @mock.patch('elodie.config.config_file', '%s/config.ini-googlephotos-upload-invalid-empty' % gettempdir()) |
|
125 | def test_googlephotos_upload_invalid_empty(): |
|
126 | with open('%s/config.ini-googlephotos-upload-invalid-empty' % gettempdir(), 'w') as f: |
|
127 | f.write(config_string_fmt) |
|
128 | if hasattr(load_config, 'config'): |
|
129 | del load_config.config |
|
130 | ||
131 | gp = GooglePhotos() |
|
132 | ||
133 | if hasattr(load_config, 'config'): |
|
134 | del load_config.config |
|
135 | ||
136 | gp.set_session() |
|
137 | status = gp.upload(helper.get_file('invalid.jpg')) |
|
138 | ||
139 | assert status is None, status |
|
140 | ||
141 | @mock.patch('elodie.config.config_file', '%s/config.ini-googlephotos-upload-dne' % gettempdir()) |
|
142 | def test_googlephotos_upload_dne(): |