def test_cd_enters_a_path_and_returns_a_node_representing_it_abs(exists): ("Node#cd should return a node representing the given path. " "Testing with absolute path") nd = Node("/foo/bar/") other = nd.cd("/etc/") other.path.should.equal('/etc')
# -*- coding: utf-8 -*- import os import shutil from plant import Node from gitgraph import GitGraph from sure import scenario node = Node(__file__).dir sandbox = node.cd('sandbox') def with_hexastore(name, **kw): if not os.path.exists(sandbox.path): os.makedirs(sandbox.path) def create_store(context): context.store_path = sandbox.join(name) context.store = GitGraph(os.path.relpath(context.store_path), **kw) def destroy_store(context): if os.path.isdir(context.store_path): shutil.rmtree(context.store_path) return scenario(create_store, destroy_store)
def test_cd_enters_a_path_and_returns_a_node_representing_it(exists): ("Node#cd should return a node representing the given path") nd = Node("/foo/bar/") other = nd.cd("awesome/") other.path.should.equal('/foo/bar/awesome')