Example #1
0
    def test_unique_identifier(self, mock_get):
        mock_response = mock.Mock(ok=True, status_code=200)
        mock_get.return_value = mock_response
        mock_response.json.return_value = {
            'data': {
                'name': 'Morty',
                'extra': {
                    'revisionId': 'Ricksy'
                }
            }
        }

        guid = GoogleDriveGuidFile(node=self.project, path='/foo/bar')

        guid.enrich()
        assert_equals('Ricksy', guid.unique_identifier)
Example #2
0
    def test_path_doesnt_crash_without_addon(self):
        guid = GoogleDriveGuidFile(node=self.project, path='/baz/foo/bar')
        self.project.delete_addon('googledrive', Auth(self.user))

        assert_is(self.project.get_addon('googledrive'), None)

        assert_true(guid.path)
        assert_true(guid.waterbutler_path)
Example #3
0
    def test_path_doesnt_crash_nonconfig_addon(self):
        guid = GoogleDriveGuidFile(node=self.project, path='/baz/foo/bar')
        self.node_addon.folder_id = None
        self.node_addon.folder_path = None
        self.node_addon.save()
        self.node_addon.reload()

        assert_true(guid.path)
        assert_true(guid.waterbutler_path)
Example #4
0
    def test_correct_path(self):
        guid = GoogleDriveGuidFile(node=self.project, path='/baz/foo/bar')

        assert_equals(guid.path, '/baz/foo/bar')
        assert_equals(guid.waterbutler_path, '/foo/bar')
Example #5
0
 def test_provider(self):
     assert_equal('googledrive', GoogleDriveGuidFile().provider)