* [gentoo-commits] proj/R_overlay:master commit in: tests/
@ 2013-07-03 10:05 André Erdmann
0 siblings, 0 replies; 4+ messages in thread
From: André Erdmann @ 2013-07-03 10:05 UTC (permalink / raw
To: gentoo-commits
commit: f13b18e412444c9ccd6824f16d4165c4c92a2447
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jul 3 09:58:37 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jul 3 09:58:37 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=f13b18e4
tests/depres: properly handle ignore dep strings
---
tests/depres.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/depres.py b/tests/depres.py
index 9be82a3..a85af56 100644
--- a/tests/depres.py
+++ b/tests/depres.py
@@ -53,7 +53,8 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
# --- end of tearDown (...) ---
def do_depres_test ( self, rule_names, test_data ):
- unpacked = lambda T: T[0] if T and len ( T ) == 1 else T
+ unpacked = lambda T: \
+ ( "" if T[0] is None else T[0] ) if T and len ( T ) == 1 else T
self.depres.compile_rules()
self.tearDown()
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: tests/
@ 2013-08-05 11:44 André Erdmann
0 siblings, 0 replies; 4+ messages in thread
From: André Erdmann @ 2013-08-05 11:44 UTC (permalink / raw
To: gentoo-commits
commit: 1eba3ab63ac8c84ce30add58cb7ed9902968b88b
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Aug 5 08:46:51 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Aug 5 08:46:51 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=1eba3ab6
tests/base.py: fixup
* use default_helper_setup() from roverlay.core
* set OVERLAY_CATEGORY=sci-R
* make_testsuite(): use generator expr instead of map()
---
tests/base.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tests/base.py b/tests/base.py
index 2d52079..7cf1364 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -6,7 +6,7 @@
import unittest
-import roverlay
+import roverlay.core
import roverlay.config.static
@@ -19,9 +19,8 @@ class BasicRoverlayTestCase ( unittest.TestCase ):
def load_config ( cls ):
# does nothing if already initialized
if cls.CONFIG is None:
- roverlay.setup_initial_logger()
- cls.CONFIG = roverlay.load_config_file (
- cls.CONFIG_FILE, setup_logger=False
+ cls.CONFIG = (
+ roverlay.core.default_helper_setup ( False, log_to_console=True )
)
# --- end of load_config (...) ---
@@ -39,10 +38,12 @@ class RoverlayTestCase ( BasicRoverlayTestCase ):
def setUpClass ( cls ):
super ( RoverlayTestCase, cls ).setUpClass()
cls.load_config()
+ # test cases expect OVERLAY_CATEGORY=sci-R (namely depres)
+ cls.CONFIG.inject ( 'OVERLAY.category', 'sci-R', suppress_log=True )
def make_testsuite ( testcase_cls ):
return unittest.TestSuite (
- map ( lambda s: testcase_cls ( "test_" + s ), testcase_cls.TESTSUITE )
+ testcase_cls ( "test_" + s ) for s in testcase_cls.TESTSUITE
)
# --- end of make_testsuite (...) ---
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: tests/
@ 2013-08-20 21:46 André Erdmann
0 siblings, 0 replies; 4+ messages in thread
From: André Erdmann @ 2013-08-20 21:46 UTC (permalink / raw
To: gentoo-commits
commit: 8aeaf4c1cad6ea8b1b95a4b5342435b607cc1a29
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Tue Aug 20 16:43:42 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Tue Aug 20 16:43:42 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=8aeaf4c1
tests/depres: force depres results as tuples
and use non-greedy channels
---
tests/depres.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/depres.py b/tests/depres.py
index 7a0af6c..77a6857 100644
--- a/tests/depres.py
+++ b/tests/depres.py
@@ -42,6 +42,12 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
"depres", roverlay.interface.depres.DepresInterface, force=True
)
cls.DEPRES_INTERFACE = cls.ROOT_INTERFACE.spawn_interface ( "depres" )
+ cls.DEPRES_INTERFACE.set_greedy ( False )
+ # for now, tuples are expected when running tests
+ # (AssertEquals ( <expected result>, <result> )
+ #
+ cls.DEPRES_INTERFACE.want_tuple = True
+ # --- end of setUpClass (...) ---
def setUp ( self ):
#ref
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: tests/
@ 2014-08-23 19:03 André Erdmann
0 siblings, 0 replies; 4+ messages in thread
From: André Erdmann @ 2014-08-23 19:03 UTC (permalink / raw
To: gentoo-commits
commit: 14ce917c1ff12f93894adcd6712a00ca5331e12a
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Sat Aug 23 18:58:55 2014 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Sat Aug 23 18:58:55 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=14ce917c
tests/depres.py: print test data identifier
Helps when tests fail.
---
tests/depres.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/depres.py b/tests/depres.py
index 77a6857..238731c 100644
--- a/tests/depres.py
+++ b/tests/depres.py
@@ -61,7 +61,7 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
self.depres.update()
# --- end of tearDown (...) ---
- def do_depres_test ( self, rule_names, test_data ):
+ def do_depres_test ( self, test_identifier, rule_names, test_data ):
unpacked = lambda T: \
( "" if T[0] is None else T[0] ) if T and len ( T ) == 1 else T
@@ -81,21 +81,21 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
self.assertEquals (
result, expected_result,
- "{!r} should be resolved as {!r} and not {!r}".format (
- depstr, expected_result, result
+ "{!s}: {!r} should be resolved as {!r} and not {!r}".format (
+ test_identifier, depstr, expected_result, result
)
)
# --- end of do_depres_test (...) ---
def do_randomized_depres_test (
- self, rule_names, test_data, allow_modify=False
+ self, test_identifier, rule_names, test_data, allow_modify=False
):
if allow_modify and isinstance ( test_data, list ):
rand_list = test_data
else:
rand_list = list ( test_data )
random.shuffle ( rand_list )
- return self.do_depres_test ( rule_names, rand_list )
+ return self.do_depres_test ( test_identifier, rule_names, rand_list )
# --- end of do_randomized_depres_test (...) ---
def get_depres_include ( self, dataset_name ):
@@ -140,6 +140,7 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
def test_depres_static ( self ):
for name, test_data in DEPRES_DATA.items():
self.do_depres_test (
+ name,
self.get_depres_include ( name ),
DEPRES_DATA [test_data] if isinstance ( test_data, str )
else test_data
@@ -153,6 +154,7 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
for name in data_keys:
test_data = DEPRES_DATA [name]
self.do_randomized_depres_test (
+ name,
self.get_depres_include ( name ),
DEPRES_DATA [test_data] if isinstance ( test_data, str )
else test_data
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-23 19:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05 11:44 [gentoo-commits] proj/R_overlay:master commit in: tests/ André Erdmann
-- strict thread matches above, loose matches on Subject: below --
2014-08-23 19:03 André Erdmann
2013-08-20 21:46 André Erdmann
2013-07-03 10:05 André Erdmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox