コード例 #1
0
ファイル: test_base.py プロジェクト: methane/markment
def test_isfile_when_exists(isfile_base):
    ("markment.fs.isfile should return os.path.isfile when given path exists")

    isfile_base.return_value = "yeah!"
    isfile("/foo", True).should.equal("yeah!")

    isfile_base.assert_called_once_with("/foo")
コード例 #2
0
ファイル: base.py プロジェクト: gabrielfalcao/markment
 def __init__(self, path):
     FakeNode.refcount += 1
     self.path = "/{0}".format(path.strip('/'))
     self.path_regex = '^{0}'.format(self.path)
     self.is_file = isfile(path, False)
     self.is_dir = isdir(path, False)
     self.exists = False
     self.metadata = Mock()
     self.metadata.atime = FakeNode.refcount
     self.metadata.ctime = FakeNode.refcount
     self.metadata.mtime = FakeNode.refcount
コード例 #3
0
ファイル: test_node.py プロジェクト: methane/markment
def test_isfile_if_path_doesnt_exists_and_hasnt_a_dot(isfile_base):
    ('fs.isfile returns result from os.path.isfile if path doesnt '
     'exist and name doesnt have not a dot')
    isfile('foobar', False).should.equal(False)
コード例 #4
0
ファイル: test_node.py プロジェクト: methane/markment
def test_isfile_if_path_doesnt_exists_and_has_dot(isfile_base):
    ('fs.isfile returns result from os.path.isfile if path doesnt '
     'exist and name has a dot')
    isfile('foobar.py', False).should.equal(True)
コード例 #5
0
ファイル: test_node.py プロジェクト: methane/markment
def test_isfile_if_path_exists(isfile_base):
    ('fs.isfile returns result from os.path.isfile if path exists')
    isfile('foobar', True).should.equal(isfile_base.return_value)
    isfile_base.assert_once_called_with('foobar')