def test_does_not_return_watch_repositories_without_member_access(self): self.given_repositories('john.doe/foo', 'otheruser/bar') self.reckon_github_read_requests() self.mocker.replay() loader = CurrentSubscriptionsLoader(StubConfig()) self.assertEquals(['john.doe/foo'], loader.load_current_subscriptions().keys())
def test_returns_all_repositories_with_watching_state(self): self.given_user_is_in_organisations('bigorg') self.given_repositories('john.doe/foo', 'bigorg/bar') self.given_subscriptions('john.doe/foo') self.reckon_github_read_requests() self.mocker.replay() loader = CurrentSubscriptionsLoader(StubConfig()) self.assertEquals({'john.doe/foo': {'watching': True}, 'bigorg/bar': {'watching': False}}, loader.load_current_subscriptions())
def __call__(self, confirmed=False): data = CurrentSubscriptionsLoader(self.config).load_current_subscriptions() data = UpdateStrategy(self.config).apply_watchlist(data) if not confirmed: self.report_changes_to_make(data) self.confirm_subscription_changes() SubscriptionsUpdater(self.config).update(data)