Use the command
charm proof to test your charm before deployment.
charm proof <path_to_charm>
Then, to test the deployment:
juju deploy --repository <somedir> local:<charmname>
<somedir> as the path to the directory above your charm (so if we have a charm stored in
~/code/charms/gitolite, it'd be
<charmname> as the name of your charm.