Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
cli: pull command migrated to docopts #145
+238
−265
Conversation
elopio
reviewed
Dec 3, 2015
| import logging | ||
| import os | ||
| import sys | ||
| import shutil | ||
| + | ||
| +# Non-Standard Library modules |
elopio
reviewed
Dec 3, 2015
elopio
reviewed
Dec 3, 2015
elopio
reviewed
Dec 3, 2015
| +# Non-Standard Library modules | ||
| +from docopt import docopt | ||
| + | ||
| +# Snapcraft modules |
elopio
reviewed
Dec 3, 2015
| + | ||
| + for part in parts: | ||
| + common.env = config.build_env_for_part(part) | ||
| + part.pull() |
elopio
Dec 3, 2015
Member
I'm confused here. It's doing only pull because you haven't migrated the other commands yet?
sergiusens
Dec 3, 2015
Collaborator
yes and pull is always going to be executed anyways; an
if cmds == 'pull':
part.pull()will always evaluate to True when I loop over the commands as it is the first one in the list.
Also, yeah, the other commands don't exist
elopio
reviewed
Dec 3, 2015
| + self.assertEqual(len(state), 1, 'Expected only one line in the state ' | ||
| + 'file for the pull1 part') | ||
| + self.assertEqual(state[0], 'pull', 'Expected the state file for pull1 ' | ||
| + 'to be \'pull\'') |
elopio
reviewed
Dec 3, 2015
| + | ||
| + for i in [0, 2]: | ||
| + self.assertFalse(os.path.exists(parts[i]['part_dir']), | ||
| + 'Expected for only to be a part dir for pull1') |
elopio
Dec 3, 2015
Member
This is hard to read. I'm not sure what are you trying to say.
Maybe something like: "Pulled wrong part."
|
Updated with all your comments @elopio |
|
|
added a commit
that referenced
this pull request
Dec 3, 2015
sergiusens
merged commit dbd9b09
into
snapcore:new-cli
Dec 3, 2015
sergiusens
deleted the
sergiusens:06-docopts-pull
branch
Dec 3, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sergiusens commentedDec 3, 2015
Signed-off-by: Sergio Schvezov sergio.schvezov@canonical.com