def test_drop(self): drop_dir = yield from rule.drop_files(self.cache, self.content_tree, ['b']) yield from shared.assert_tree_contents(self.cache, drop_dir, { 'a': 'foo', COLON + 'd': 'baz' }) drop_file = yield from rule.drop_files(self.cache, self.content_tree, ['a']) yield from shared.assert_tree_contents(self.cache, drop_file, { 'b/c': 'bar', COLON + 'd': 'baz' }) drop_colon = yield from rule.drop_files(self.cache, self.content_tree, [COLON + 'd']) yield from shared.assert_tree_contents(self.cache, drop_colon, { 'a': 'foo', 'b/c': 'bar' }) globs = yield from rule.drop_files(self.cache, self.content_tree, ['**/c', '**/a']) yield from shared.assert_tree_contents(self.cache, globs, {COLON + 'd': 'baz'})
def test_pick(self): pick_dir = yield from rule.pick_files(self.cache, self.content_tree, ["b"]) yield from shared.assert_tree_contents(self.cache, pick_dir, {"b/c": "bar"}) pick_file = yield from rule.pick_files(self.cache, self.content_tree, ["a"]) yield from shared.assert_tree_contents(self.cache, pick_file, {"a": "foo"}) globs = yield from rule.pick_files(self.cache, self.content_tree, ["**/c", "**/a"]) yield from shared.assert_tree_contents(self.cache, globs, {"a": "foo", "b/c": "bar"})
def test_move(self): # Same semantics as copy above. Also, make sure that move deletes move # sources, but does not delete sources that were overwritten by the # target of another move. moves = {'a': 'b', 'b': 'a'} tree = rule.move_files(self.cache, self.content_tree, moves) shared.assert_tree_contents(self.cache, tree, { 'a/c': 'bar', 'b/a': 'foo', })
def test_copy(self): # A file copied into a directory should be placed into that directory. # A directory or file copied into a file should overwrite that file. copies = {'a': ['x', 'b', 'b/c'], 'b': ['a', 'y']} tree = rule.copy_files(self.cache, self.content_tree, copies) shared.assert_tree_contents(self.cache, tree, { 'a/c': 'bar', 'b/a': 'foo', 'b/c': 'foo', 'x': 'foo', 'y/c': 'bar', })
def test_pick(self): pick_dir = yield from rule.pick_files( self.cache, self.content_tree, ['b']) yield from shared.assert_tree_contents( self.cache, pick_dir, {'b/c': 'bar'}) pick_file = yield from rule.pick_files( self.cache, self.content_tree, ['a']) yield from shared.assert_tree_contents( self.cache, pick_file, {'a': 'foo'}) globs = yield from rule.pick_files( self.cache, self.content_tree, ['**/c', '**/a']) yield from shared.assert_tree_contents( self.cache, globs, {'a': 'foo', 'b/c': 'bar'})
def test_drop(self): drop_dir = yield from rule.drop_files( self.cache, self.content_tree, ['b']) yield from shared.assert_tree_contents( self.cache, drop_dir, {'a': 'foo'}) drop_file = yield from rule.drop_files( self.cache, self.content_tree, ['a']) yield from shared.assert_tree_contents( self.cache, drop_file, {'b/c': 'bar'}) globs = yield from rule.drop_files( self.cache, self.content_tree, ['**/c', '**/a']) yield from shared.assert_tree_contents( self.cache, globs, {})
def test_move(self): # Same semantics as copy above. Also, make sure that move deletes move # sources, but does not delete sources that were overwritten by the # target of another move. moves = {"a": "b", "b": "a"} tree = yield from rule.move_files(self.cache, self.content_tree, moves) yield from shared.assert_tree_contents(self.cache, tree, {"a/c": "bar", "b/a": "foo"})
def test_copy(self): # A file copied into a directory should be placed into that directory. # A directory or file copied into a file should overwrite that file. copies = {"a": ["x", "b", "b/c"], "b": ["a", "y"]} tree = yield from rule.copy_files(self.cache, self.content_tree, copies) yield from shared.assert_tree_contents( self.cache, tree, {"a/c": "bar", "b/a": "foo", "b/c": "foo", "x": "foo", "y/c": "bar"} )
def test_pick(self): pick_dir = yield from rule.pick_files(self.cache, self.content_tree, ['b']) yield from shared.assert_tree_contents(self.cache, pick_dir, {'b/c': 'bar'}) pick_file = yield from rule.pick_files(self.cache, self.content_tree, ['a']) yield from shared.assert_tree_contents(self.cache, pick_file, {'a': 'foo'}) pick_colon = yield from rule.pick_files(self.cache, self.content_tree, [COLON + 'd']) yield from shared.assert_tree_contents(self.cache, pick_colon, {COLON + 'd': 'baz'}) globs = yield from rule.pick_files(self.cache, self.content_tree, ['**/c', '**/a']) yield from shared.assert_tree_contents(self.cache, globs, { 'a': 'foo', 'b/c': 'bar' })
def test_pick(self): pick_dir = rule.pick_files(self.cache, self.content_tree, ['b']) shared.assert_tree_contents(self.cache, pick_dir, {'b/c': 'bar'}) pick_file = rule.pick_files(self.cache, self.content_tree, ['a']) shared.assert_tree_contents(self.cache, pick_file, {'a': 'foo'}) globs = rule.pick_files(self.cache, self.content_tree, ['**/c', '**/a']) shared.assert_tree_contents(self.cache, globs, { 'a': 'foo', 'b/c': 'bar' })
def test_export(self): b = yield from rule.get_export_tree( self.cache, self.content_tree, 'b') yield from shared.assert_tree_contents(self.cache, b, {'c': 'bar'})
def test_export(self): b = rule.get_export_tree(self.cache, self.content_tree, 'b') shared.assert_tree_contents(self.cache, b, {'c': 'bar'})
def test_export(self): b = yield from rule.get_export_tree(self.cache, self.content_tree, "b") yield from shared.assert_tree_contents(self.cache, b, {"c": "bar"})