Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sick-Beard
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
Sick-Beard
Commits
704b216b
Commit
704b216b
authored
Apr 20, 2012
by
Dennis Lutter
Browse files
Options
Downloads
Patches
Plain Diff
add: simple full pp test and needed changes to test_lib and refactoring of a fake/dummy function
parent
b8d1825f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/pp_tests.py
+12
-5
12 additions, 5 deletions
tests/pp_tests.py
tests/snatch_tests.py
+0
-6
0 additions, 6 deletions
tests/snatch_tests.py
tests/test_lib.py
+19
-0
19 additions, 0 deletions
tests/test_lib.py
with
31 additions
and
11 deletions
tests/pp_tests.py
+
12
−
5
View file @
704b216b
...
@@ -80,13 +80,20 @@ class PPPrivateTests(test.SickbeardTestDBCase):
...
@@ -80,13 +80,20 @@ class PPPrivateTests(test.SickbeardTestDBCase):
class
PPBasicTests
(
test
.
SickbeardTestDBCase
):
class
PPBasicTests
(
test
.
SickbeardTestDBCase
):
def
setUp
(
self
):
super
(
PPBasicTests
,
self
).
setUp
()
self
.
pp
=
PostProcessor
(
test
.
FILEPATH
)
@unittest.skip
(
"
this test is not fully configured / implmented
"
)
def
test_process
(
self
):
def
test_process
(
self
):
self
.
assertTrue
(
self
.
pp
.
process
())
show
=
TVShow
(
3
)
show
.
name
=
test
.
SHOWNAME
show
.
location
=
test
.
SHOWDIR
show
.
saveToDB
()
sickbeard
.
showList
=
[
show
]
ep
=
TVEpisode
(
show
,
test
.
SEASON
,
test
.
EPISODE
)
ep
.
name
=
"
some ep name
"
ep
.
saveToDB
()
pp
=
PostProcessor
(
test
.
FILEPATH
)
self
.
assertTrue
(
pp
.
process
())
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
tests/snatch_tests.py
+
0
−
6
View file @
704b216b
...
@@ -44,12 +44,6 @@ def _create_fake_xml(items):
...
@@ -44,12 +44,6 @@ def _create_fake_xml(items):
return
xml
return
xml
# the real one tries to contact tvdb just stop it from getting more info on the ep
def
_fake_specifyEP
(
self
,
season
,
episode
):
pass
TVEpisode
.
specifyEpisode
=
_fake_specifyEP
searchItems
=
[]
searchItems
=
[]
...
...
This diff is collapsed.
Click to expand it.
tests/test_lib.py
+
19
−
0
View file @
704b216b
...
@@ -47,6 +47,8 @@ FILENAME = u"show name - s0" + str(SEASON) + "e0" + str(EPISODE) + ".mkv"
...
@@ -47,6 +47,8 @@ FILENAME = u"show name - s0" + str(SEASON) + "e0" + str(EPISODE) + ".mkv"
FILEDIR
=
os
.
path
.
join
(
TESTDIR
,
SHOWNAME
)
FILEDIR
=
os
.
path
.
join
(
TESTDIR
,
SHOWNAME
)
FILEPATH
=
os
.
path
.
join
(
FILEDIR
,
FILENAME
)
FILEPATH
=
os
.
path
.
join
(
FILEDIR
,
FILENAME
)
SHOWDIR
=
os
.
path
.
join
(
TESTDIR
,
SHOWNAME
+
"
final
"
)
#sickbeard.logger.sb_log_instance = sickbeard.logger.SBRotatingLogHandler(os.path.join(TESTDIR, 'sickbeard.log'), sickbeard.logger.NUM_LOGS, sickbeard.logger.LOG_SIZE)
#sickbeard.logger.sb_log_instance = sickbeard.logger.SBRotatingLogHandler(os.path.join(TESTDIR, 'sickbeard.log'), sickbeard.logger.NUM_LOGS, sickbeard.logger.LOG_SIZE)
sickbeard
.
logger
.
SBRotatingLogHandler
.
log_file
=
os
.
path
.
join
(
os
.
path
.
join
(
TESTDIR
,
'
Logs
'
),
'
test_sickbeard.log
'
)
sickbeard
.
logger
.
SBRotatingLogHandler
.
log_file
=
os
.
path
.
join
(
os
.
path
.
join
(
TESTDIR
,
'
Logs
'
),
'
test_sickbeard.log
'
)
...
@@ -96,6 +98,12 @@ def _dummy_saveConfig():
...
@@ -96,6 +98,12 @@ def _dummy_saveConfig():
# this might be considered a hack
# this might be considered a hack
mainDB
.
sickbeard
.
save_config
=
_dummy_saveConfig
mainDB
.
sickbeard
.
save_config
=
_dummy_saveConfig
# the real one tries to contact tvdb just stop it from getting more info on the ep
def
_fake_specifyEP
(
self
,
season
,
episode
):
pass
sickbeard
.
tv
.
TVEpisode
.
specifyEpisode
=
_fake_specifyEP
#=================
#=================
# test classes
# test classes
...
@@ -105,11 +113,13 @@ class SickbeardTestDBCase(unittest.TestCase):
...
@@ -105,11 +113,13 @@ class SickbeardTestDBCase(unittest.TestCase):
sickbeard
.
showList
=
[]
sickbeard
.
showList
=
[]
setUp_test_db
()
setUp_test_db
()
setUp_test_episode_file
()
setUp_test_episode_file
()
setUp_test_show_dir
()
def
tearDown
(
self
):
def
tearDown
(
self
):
sickbeard
.
showList
=
[]
sickbeard
.
showList
=
[]
tearDown_test_db
()
tearDown_test_db
()
tearDown_test_episode_file
()
tearDown_test_episode_file
()
tearDown_test_show_dir
()
class
TestDBConnection
(
db
.
DBConnection
,
object
):
class
TestDBConnection
(
db
.
DBConnection
,
object
):
...
@@ -185,6 +195,15 @@ def setUp_test_episode_file():
...
@@ -185,6 +195,15 @@ def setUp_test_episode_file():
def
tearDown_test_episode_file
():
def
tearDown_test_episode_file
():
shutil
.
rmtree
(
FILEDIR
)
shutil
.
rmtree
(
FILEDIR
)
def
setUp_test_show_dir
():
if
not
os
.
path
.
exists
(
SHOWDIR
):
os
.
makedirs
(
SHOWDIR
)
def
tearDown_test_show_dir
():
shutil
.
rmtree
(
SHOWDIR
)
tearDown_test_db
()
tearDown_test_db
()
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
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