コード例 #1
0
ファイル: test_dochelpers.py プロジェクト: Python3pkg/PyMVPA
 def test_strip_strid(self):
     self.assertEqual(
         strip_strid("#1"),
         "#1")  # very short ones left alone -- unlikely to be id
     self.assertEqual(strip_strid("#140136298269872"),
                      "")  # long ones replaced
     self.assertEqual(strip_strid("a#140136298269872 b#140136298269872"),
                      "a b")  # multiple
コード例 #2
0
ファイル: tools.py プロジェクト: Python3pkg/PyMVPA
def assert_reprstr_equal(x, y):
    """Whenever comparison fails otherwise, we might revert to compare those"""
    if __debug__ and ("ID_IN_REPR" in debug.active or "DS_ID" in debug.active):
        repr_ = lambda x: strip_strid(repr(x))
        str_ = lambda x: strip_strid(str(x))
    else:
        repr_, str_ = repr, str
    assert_equal(repr_(x), repr_(y))
    assert_equal(str_(x), str_(y))
コード例 #3
0
ファイル: tools.py プロジェクト: PyMVPA/PyMVPA
def assert_reprstr_equal(x, y):
    """Whenever comparison fails otherwise, we might revert to compare those"""
    if __debug__ and ("ID_IN_REPR" in debug.active or "DS_ID" in debug.active):
        repr_ = lambda x: strip_strid(repr(x))
        str_ = lambda x: strip_strid(str(x))
    else:
        repr_, str_ = repr, str
    assert_equal(repr_(x), repr_(y))
    assert_equal(str_(x), str_(y))
コード例 #4
0
ファイル: test_dochelpers.py プロジェクト: Anhmike/PyMVPA
 def test_strip_strid(self):
     self.assertEqual(strip_strid("#1"), "#1")  # very short ones left alone -- unlikely to be id
     self.assertEqual(strip_strid("#140136298269872"), "") # long ones replaced
     self.assertEqual(strip_strid("a#140136298269872 b#140136298269872"), "a b") # multiple