當前位置: 首頁>>代碼示例>>Python>>正文


Python Selector.wantDirectory方法代碼示例

本文整理匯總了Python中nose.selector.Selector.wantDirectory方法的典型用法代碼示例。如果您正苦於以下問題:Python Selector.wantDirectory方法的具體用法?Python Selector.wantDirectory怎麽用?Python Selector.wantDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nose.selector.Selector的用法示例。


在下文中一共展示了Selector.wantDirectory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_want_directory

# 需要導入模塊: from nose.selector import Selector [as 別名]
# 或者: from nose.selector.Selector import wantDirectory [as 別名]
    def test_want_directory(self):
        s = Selector(Config())
        assert s.wantDirectory('test')
        assert not s.wantDirectory('test/whatever')
        assert s.wantDirectory('whatever/test')
        assert not s.wantDirectory('/some/path/to/unit_tests/support')

        # default src directory
        assert s.wantDirectory('lib')
        assert s.wantDirectory('src')

        # FIXME move to functional tests
        
        # this looks on disk for support/foo, which is a package
        here = os.path.abspath(os.path.dirname(__file__))
        support = os.path.join(here, 'support')
        tp = os.path.normpath(os.path.join(support, 'foo'))
        assert s.wantDirectory(tp)
        # this looks for support, which is not a package
        assert not s.wantDirectory(support)        
開發者ID:ANKIT-KS,項目名稱:fjord,代碼行數:22,代碼來源:test_selector.py

示例2: test_want_directory

# 需要導入模塊: from nose.selector import Selector [as 別名]
# 或者: from nose.selector.Selector import wantDirectory [as 別名]
    def test_want_directory(self):
        s = Selector(Config())
        assert s.wantDirectory("test")
        assert not s.wantDirectory("test/whatever")
        assert s.wantDirectory("whatever/test")
        assert not s.wantDirectory("/some/path/to/unit_tests/support")

        # default src directory
        assert s.wantDirectory("lib")
        assert s.wantDirectory("src")

        # FIXME move to functional tests

        # this looks on disk for support/foo, which is a package
        here = os.path.abspath(os.path.dirname(__file__))
        support = os.path.join(here, "support")
        tp = os.path.normpath(os.path.join(support, "foo"))
        assert s.wantDirectory(tp)
        # this looks for support, which is not a package
        assert not s.wantDirectory(support)
開發者ID:GaloisInc,項目名稱:echronos,代碼行數:22,代碼來源:test_selector.py


注:本文中的nose.selector.Selector.wantDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。