Skip to content

Commit f4913fd

Browse files
prashant-gurung899TheOneRing
authored andcommitted
Merge pull request #20 from JankariTech/cleanup
Cleanup code
1 parent b9a0724 commit f4913fd

18 files changed

+74
-719
lines changed

test/gui/config.sample.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ CLIENT_LOG_FILE=
99
TEMP_FOLDER_PATH=
1010
CLIENT_CONFIG_DIR=
1111
GUI_TEST_REPORT_DIR=
12-
OCIS=false
13-
RECORD_VIDEO_ON_FAILURE=false
12+
RECORD_VIDEO_ON_FAILURE=false

test/gui/shared/scripts/bdd_hooks.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from helpers.StacktraceHelper import get_core_dumps, generate_stacktrace
2323
from helpers.SyncHelper import close_socket_connection, clear_waited_after_sync
2424
from helpers.SpaceHelper import delete_project_spaces
25-
from helpers.api.provisioning import delete_created_groups, delete_created_users
25+
from helpers.api.provisioning import delete_created_users
2626
from helpers.SetupClientHelper import wait_until_app_killed, unlock_keyring
2727
from helpers.ConfigHelper import (
2828
init_config,
@@ -34,7 +34,6 @@
3434
)
3535
from helpers.FilesHelper import prefix_path_namespace, cleanup_created_paths
3636
from helpers.ReportHelper import save_video_recording, take_screenshot, is_video_enabled
37-
import helpers.api.oc10 as oc
3837

3938
from pageObjects.Toolbar import Toolbar
4039
from pageObjects.AccountSetting import AccountSetting
@@ -70,7 +69,7 @@ def hook(context):
7069
# Order: 2
7170
@OnScenarioStart
7271
def hook(context):
73-
# set owncloud config file path
72+
# set opencloud config file path
7473
config_dir = get_config("clientConfigDir")
7574
if os.path.exists(config_dir):
7675
if len(os.listdir(config_dir)) and is_windows():
@@ -170,11 +169,7 @@ def hook(context):
170169
# server cleanup
171170
@OnScenarioEnd
172171
def hook(context):
173-
if get_config("ocis"):
174-
delete_project_spaces()
175-
else:
176-
oc.restore_apps_state()
177-
delete_created_groups()
172+
delete_project_spaces()
178173
delete_created_users()
179174

180175

test/gui/shared/scripts/helpers/ConfigHelper.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def get_default_home_dir():
7474
'tempFolderPath': 'TEMP_FOLDER_PATH',
7575
'clientConfigDir': 'CLIENT_CONFIG_DIR',
7676
'guiTestReportDir': 'GUI_TEST_REPORT_DIR',
77-
'ocis': 'OCIS',
7877
'record_video_on_failure': 'RECORD_VIDEO_ON_FAILURE'
7978
}
8079

@@ -97,7 +96,6 @@ def get_default_home_dir():
9796
'tempFolderPath': os.path.join(get_client_root_path(), 'temp'),
9897
'clientConfigDir': get_config_home(),
9998
'guiTestReportDir': os.path.abspath('../reports'),
100-
'ocis': False,
10199
'record_video_on_failure': False,
102100
'files_for_upload': os.path.join(CURRENT_DIR.parent.parent, 'files-for-upload'),
103101
'syncConnectionName': 'Personal'
@@ -115,7 +113,7 @@ def read_cfg_file(cfg_path):
115113
for key, _ in CONFIG.items():
116114
if key in CONFIG_ENV_MAP:
117115
if value := cfg.get('DEFAULT', CONFIG_ENV_MAP[key]):
118-
if key in ('ocis', 'record_video_on_failure'):
116+
if key == 'record_video_on_failure':
119117
CONFIG[key] = value == 'true'
120118
else:
121119
CONFIG[key] = value
@@ -135,7 +133,7 @@ def init_config():
135133
# read and override configs from environment variables
136134
for key, value in CONFIG_ENV_MAP.items():
137135
if os.environ.get(value):
138-
if key in ('ocis', 'record_video_on_failure'):
136+
if key == 'record_video_on_failure':
139137
CONFIG[key] = os.environ.get(value) == 'true'
140138
else:
141139
CONFIG[key] = os.environ.get(value)

test/gui/shared/scripts/helpers/SetupClientHelper.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from helpers.api.utils import url_join
1616
from helpers.UserHelper import get_displayname_for_user, get_password_for_user
1717
from helpers.ReportHelper import is_video_enabled
18-
from helpers.api import ocis
18+
from helpers.api import provisioning
1919

2020

2121

@@ -80,9 +80,8 @@ def get_resource_path(resource='', user='', space=''):
8080
sync_path = get_config('currentUserSyncPath')
8181
if user:
8282
sync_path = user
83-
if get_config('ocis'):
84-
space = space or get_config('syncConnectionName')
85-
sync_path = join(sync_path, space)
83+
space = space or get_config('syncConnectionName')
84+
sync_path = join(sync_path, space)
8685
sync_path = join(get_config('clientRootSyncPath'), sync_path)
8786
resource = resource.replace(sync_path, '').strip('/').strip('\\')
8887
if is_windows():
@@ -136,7 +135,7 @@ def generate_account_config(users, space='Personal'):
136135
settings = QSettings("OpenCloud", "opencloud")
137136
users_uuids = {}
138137
server_url = get_config('localBackendUrl')
139-
capabilities = ocis.get_capabilities()
138+
capabilities = provisioning.get_capabilities()
140139
capabilities_variant = QJsonValue(capabilities).toVariant()
141140

142141
for idx, username in enumerate(users):

test/gui/shared/scripts/helpers/SyncHelper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ def get_initial_sync_patterns():
143143
def get_synced_pattern(resource=''):
144144
# get only the resource path
145145
sync_path = get_config('currentUserSyncPath')
146-
if get_config('ocis'):
147-
sync_path = os.path.join(sync_path, get_config('syncConnectionName'))
146+
sync_path = os.path.join(sync_path, get_config('syncConnectionName'))
148147

149148
if resource := resource.replace(sync_path, '').strip('\\').strip('/'):
150149
return SYNC_PATTERNS['single_synced']

test/gui/shared/scripts/helpers/api/oc10.py

Lines changed: 0 additions & 140 deletions
This file was deleted.

test/gui/shared/scripts/helpers/api/ocis.py

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)