def test_public_repo_and_default_bitbucket_workspace(self): with self.config: self.config.get_credentials('bitbucket').returns( ripio.Credentials(BITBUCKET_CREDENTIALS)) sut = ripio.Completion('ripio', self.config) self.assertEquals(sut.found, ['bitbucket:DavidVilla/ripio'])
def setUp(self): self.credentials = ripio.Credentials(BITBUCKET_CREDENTIALS) self.public_repos = ['repo{}'.format(x) for x in range(12)] + ['empty', 'ripio'] self.all_repos = self.public_repos + ['empty', 'private'] self.prefix = 'bitbucket:' self.abbreviated_prefix = 'bb:'
def test_already_user(self): url = 'https://[email protected]/repo-test/repo11.git' expected = 'https://john.doe:[email protected]/repo-test/repo11.git' credentials = ripio.Credentials('john.doe:secret') sut = ripio.Auth(credentials) result = sut.auth(url) self.assertEquals(result, expected)
def make_repo(cls, name, auth=True): creds = ripio.Credentials(BITBUCKET_CREDENTIALS) if auth else None print(creds) return ripio.BitbucketRepo(name, creds)
def setUp(self): self.credentials = ripio.Credentials(GITHUB_CREDENTIALS) self.all_repos = self.public_repos + ['private', 'empty'] self.prefix = 'github:' self.abbreviated_prefix = 'gh:'
def test_bitbucket_credentials(self): sut = ripio.ConfigFile('test/fixtures/bitbucket.conf') result = sut.get_credentials('bitbucket') self.assertEquals(result, ripio.Credentials('john.doe:secret'))
def make_repo(cls, name, auth=True): creds = ripio.Credentials(GITHUB_CREDENTIALS) if auth else None return ripio.GithubRepo(name, creds)