def test_update_git_only(self):
     args = self.parser.parse_args(['update', '--git'])
     os.mkdir(os.path.join(self.locations()['tree'], 'solitude'))
     with mock.patch('mkt.cmds.subprocess') as subprocess:
         with mock.patch('mkt.cmds.fig_command') as fig:
             cmds.update(args, self.parser)
             assert subprocess.check_output.called
             assert not fig.called
    def test_update(self):
        args = self.parser.parse_args(['update'])
        os.mkdir(os.path.join(self.locations()['tree'], 'solitude'))

        with mock.patch('mkt.cmds.subprocess') as subprocess:
            with mock.patch('mkt.cmds.fig_command') as fig:
                cmds.update(args, self.parser)
                subprocess.check_output.assert_called_with(
                    ['git', 'pull', '-q'])
                fig.assert_called_with(
                    'run', '--rm', 'solitude', 'schematic', 'migrations')
 def test_update_no_dir(self):
     args = self.parser.parse_args(['update'])
     with self.assertRaises(OSError):
         cmds.update(args, self.parser)