<commit_before>import os
import time

from nxdrive.tests.common import IntegrationTestCase
from nxdrive.client import LocalClient


class TestConflicts(IntegrationTestCase):

    def setUp(self):
        super(TestConflicts, self).setUp()
        # Mark workspace as sync root for user 1 and create file inside it
        self.remote_document_client_1.register_as_root(self.workspace)
        toplevel_folder_info = self.remote_file_system_client_1.get_filesystem_root_info()
        self.workspace_id = self.remote_file_system_client_1.get_children_info(toplevel_folder_info.uid)[0].uid
        self.file_id = self.remote_file_system_client_1.make_file(self.workspace_id, 'test.txt', 'Some content')

    def test_self_conflict(self):
        ctl = self.controller_1
        ctl.bind_server(self.local_nxdrive_folder_1, self.nuxeo_url,
                        self.user_1, self.password_1)
        local = LocalClient(os.path.join(self.local_nxdrive_folder_1,
                                         self.workspace_title))
        remote = self.remote_file_system_client_1
        syn = ctl.synchronizer
<commit_msg>NXDRIVE-147: Don't run self-conflict test if not implemented server-side<commit_after>import os
import time

from nxdrive.tests.common import IntegrationTestCase
from nxdrive.client import LocalClient
from nose.plugins.skip import SkipTest


class TestConflicts(IntegrationTestCase):

    def setUp(self):
        super(TestConflicts, self).setUp()
        # Mark workspace as sync root for user 1 and create file inside it
        self.remote_document_client_1.register_as_root(self.workspace)
        toplevel_folder_info = self.remote_file_system_client_1.get_filesystem_root_info()
        self.workspace_id = self.remote_file_system_client_1.get_children_info(toplevel_folder_info.uid)[0].uid
        self.file_id = self.remote_file_system_client_1.make_file(self.workspace_id, 'test.txt', 'Some content')

    def test_self_conflict(self):
        ctl = self.controller_1
        sb = ctl.bind_server(self.local_nxdrive_folder_1, self.nuxeo_url,
                        self.user_1, self.password_1)
        if not ctl.get_top_level_state(self.local_nxdrive_folder_1).last_remote_modifier:
            raise SkipTest("Self-conflict automatic resolution not implemented in Nuxeo Platform %s"
                           % sb.server_version)
        local = LocalClient(os.path.join(self.local_nxdrive_folder_1,
                                         self.workspace_title))
        remote = self.remote_file_system_client_1
        syn = ctl.synchronizer

{'fraction_non_alphanumeric': 0.0721489526764934, 'fraction_numerical': 0.010861132660977503, 'mean_word_length': 3.2348111658456484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1556605', 'n_tokens_mistral': 805, 'n_tokens_neox': 779, 'n_words': 139}