Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
de21abe9
Commit
de21abe9
authored
16 years ago
by
Brendan Taylor
Browse files
Options
Downloads
Patches
Plain Diff
split off test initialization code
parent
f69299f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/test_sessions.py
+3
-29
3 additions, 29 deletions
test/test_sessions.py
test/testlib.py
+32
-0
32 additions, 0 deletions
test/testlib.py
with
35 additions
and
29 deletions
test/test_sessions.py
+
3
−
29
View file @
de21abe9
import
unittest
import
sys
import
os.path
gajim_root
=
os
.
path
.
join
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)),
'
..
'
)
sys
.
path
.
append
(
gajim_root
+
'
/src
'
)
# a temporary version of ~/.gajim for testing
configdir
=
gajim_root
+
'
/test/tmp
'
# define _ for i18n
import
__builtin__
__builtin__
.
_
=
lambda
x
:
x
# wipe config directory
import
os
if
os
.
path
.
isdir
(
configdir
):
import
shutil
shutil
.
rmtree
(
configdir
)
os
.
mkdir
(
configdir
)
import
common.configpaths
common
.
configpaths
.
gajimpaths
.
init
(
configdir
)
common
.
configpaths
.
gajimpaths
.
init_profile
()
import
time
# for some reason common.gajim needs to be imported before xmpppy?
import
testlib
testlib
.
setup_env
()
from
common
import
gajim
from
common
import
xmpp
from
mock
import
Mock
,
expectParams
from
mocks
import
*
gajim
.
DATA_DIR
=
gajim_root
+
'
/data
'
from
common.stanza_session
import
StanzaSession
# name to use for the test account
...
...
This diff is collapsed.
Click to expand it.
test/testlib.py
0 → 100644
+
32
−
0
View file @
de21abe9
import
sys
import
os.path
gajim_root
=
os
.
path
.
join
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)),
'
..
'
)
sys
.
path
.
append
(
gajim_root
+
'
/src
'
)
# a temporary version of ~/.gajim for testing
configdir
=
gajim_root
+
'
/test/tmp
'
# define _ for i18n
import
__builtin__
__builtin__
.
_
=
lambda
x
:
x
import
os
def
setup_env
():
# wipe config directory
if
os
.
path
.
isdir
(
configdir
):
import
shutil
shutil
.
rmtree
(
configdir
)
os
.
mkdir
(
configdir
)
import
common.configpaths
common
.
configpaths
.
gajimpaths
.
init
(
configdir
)
common
.
configpaths
.
gajimpaths
.
init_profile
()
# for some reason common.gajim needs to be imported before xmpppy?
from
common
import
gajim
gajim
.
DATA_DIR
=
gajim_root
+
'
/data
'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment