def save_to_dir(self, dirpath): """ Save each of the items in this package as a file in a directory at *dirpath*, using the pack URI as the relative path of each file. If the directory exists, it is deleted (recursively) before being recreated. """ PhysPkg.write_to_dir(self._blobs, dirpath)
def it_can_write_a_blob_collection_to_a_directory(self, uri_, uri_2_, blob_, blob_2_, PhysPkg_): # fixture ---------------------- blobs = BlobCollection(((uri_, blob_), (uri_2_, blob_2_))) # exercise --------------------- PhysPkg.write_to_dir(blobs, DIRPATH) # verify ----------------------- PhysPkg_._clear_or_make_dir.assert_called_once_with(DIRPATH) PhysPkg_._write_blob_to_dir.assert_has_calls( (call(DIRPATH, uri_, blob_), call(DIRPATH, uri_2_, blob_2_)), any_order=True )