Code Duplication    Length = 16-16 lines in 2 locations

elodie/tests/plugins/googlephotos/googlephotos_test.py 2 locations

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