コード例 #1
0
 def test_creates_directory(self, mocked_exists, mocked_get, mocked_run):
     repos = clone_army.repositories('18F')
     repo1 = clone_army.Repository(repos.__next__())
     repo1.synch()
     mocked_run.assert_called_with([
         'git', 'clone',
         'https://*****:*****@github.com/18F/14c-prototype.git'
     ])
コード例 #2
0
 def test_args_passed_when_cloning(self, mocked_get, mocked_run):
     repos = clone_army.repositories('18F')
     repo1 = clone_army.Repository(repos.__next__())
     assert not os.path.exists(repo1.name)
     repo1.synch('--depth', '1')
     mocked_run.assert_called_with(
         ['git', 'clone', '--depth', '1',
          'https://github.com/18F/14c-prototype.git'])
コード例 #3
0
 def test_auth_info_passed_when_provided(self, mocked_get, mocked_run):
     repos = clone_army.repositories('18F')
     repo1 = clone_army.Repository(repos.__next__())
     assert not os.path.exists(repo1.name)
     repo1.synch(('myusername', 'mypassword'), '--depth', '1')
     mocked_run.assert_called_with([
         'git', 'clone', '--depth', '1',
         'https://*****:*****@github.com/18F/14c-prototype.git'
     ])
コード例 #4
0
 def test_no_such_repo(self, mocked_get):
     with pytest.raises(requests.exceptions.HTTPError):
         result = clone_army.repositories('there is no such repo')
         result.__next__()
コード例 #5
0
 def test_filtered_repo_list(self, mocked_get):
     for repo in clone_army.repositories('18F', filter=r'gsa'):
         assert 'gsa' in repo['name']
コード例 #6
0
 def test_lists_user_repos(self, mocked_get):
     repos = clone_army.repositories('catherinedevlin', type='user')
     repos.__next__()
     assert 'https://api.github.com/users' in mocked_get.call_args[0][0]
コード例 #7
0
 def test_lists_org_repos(self, mocked_get):
     repos = clone_army.repositories('18F')
     repos.__next__()
     assert 'https://api.github.com/orgs' in mocked_get.call_args[0][0]
コード例 #8
0
 def test_pulls_when_dir_exists(self, mocked_exists, mocked_get,
                                mocked_run):
     repos = clone_army.repositories('18F')
     repo1 = clone_army.Repository(repos.__next__())
     repo1.synch()
     mocked_run.assert_called_with(['git', 'pull'], cwd=repo1.name)
コード例 #9
0
 def test_creates_directory(self, mocked_exists, mocked_get, mocked_run):
     repos = clone_army.repositories('18F')
     repo1 = clone_army.Repository(repos.__next__())
     repo1.synch()
     mocked_run.assert_called_with(['git', 'clone', repo1.clone_url])
コード例 #10
0
ファイル: test_clone_army.py プロジェクト: 18F/clone_army
 def test_no_such_repo(self, mocked_get):
     with pytest.raises(requests.exceptions.HTTPError):
         result = clone_army.repositories('there is no such repo')
         result.__next__()
コード例 #11
0
ファイル: test_clone_army.py プロジェクト: 18F/clone_army
 def test_filtered_repo_list(self, mocked_get):
     for repo in clone_army.repositories('18F', filter=r'gsa'):
         assert 'gsa' in repo['name']
コード例 #12
0
ファイル: test_clone_army.py プロジェクト: 18F/clone_army
 def test_lists_user_repos(self, mocked_get):
     repos = clone_army.repositories('catherinedevlin', type='user')
     repos.__next__()
     assert 'https://api.github.com/users' in mocked_get.call_args[0][0]
コード例 #13
0
ファイル: test_clone_army.py プロジェクト: 18F/clone_army
 def test_lists_org_repos(self, mocked_get):
     repos = clone_army.repositories('18F')
     repos.__next__()
     assert 'https://api.github.com/orgs' in mocked_get.call_args[0][0]
コード例 #14
0
ファイル: test_clone_army.py プロジェクト: 18F/clone_army
 def test_pulls_when_dir_exists(self, mocked_exists, mocked_get,
                                mocked_run):
     repos = clone_army.repositories('18F')
     repo1 = clone_army.Repository(repos.__next__())
     repo1.synch()
     mocked_run.assert_called_with(['git', 'pull'], cwd=repo1.name)