def test_sync_skips_push_when_in_nopush_mode(self): syncCmd = Sync() syncCmd.run(strict=True, addnew=False, push=False, message='commit message') yawtext.sync.vc_push.assert_not_called()
def test_sync_pushes_if_asked(self): syncCmd = Sync() syncCmd.run(strict=True, addnew=False, push=True, message='commit message') yawtext.sync.vc_push.assert_called_with()
def test_sync_supplies_commit_message(self): syncCmd = Sync() syncCmd.run(strict=True, addnew=False, push=False, message=None) yawtext.sync.vc_commit.assert_called_with('synced changes')
def test_sync_commits_in_strict_mode(self): syncCmd = Sync() syncCmd.run(strict=True, addnew=False, push=False, message='commit message') yawtext.sync.vc_commit.assert_called_with('commit message')
def test_sync_adds_new_when_asked(self): syncCmd = Sync() syncCmd.run(strict=False, addnew=True, push=False, message='commit message') yawtext.sync.vc_add_tracked_and_new.assert_called_with() yawtext.sync.vc_add_tracked.assert_not_called()
def test_sync_skips_adding_and_status_in_strict_mode(self): syncCmd = Sync() syncCmd.run(strict=True, addnew=False, push=False, message='commit message') yawtext.sync.vc_add_tracked.assert_not_called() yawtext.sync.vc_add_tracked_and_new.assert_not_called() yawtext.sync.vc_status.assert_not_called()
def test_call_plugins_called_with_status_results(self): changed = yawt.utils.ChangedFiles(modified=['content/index.txt']) yawtext.sync.vc_status.return_value = changed syncCmd = Sync() syncCmd.run(strict=False, addnew=False, push=False, message='commit message') yawtext.sync.call_plugins.assert_called_with('on_pre_sync', changed)