def test_create_project(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() gh._create_project(repo, 'testOrg', 'testBody') repo.create_project.assert_called_with('testOrg', body='testBody')
def test_create_label(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() gh._create_label(repo, 'testLabel', '000000') repo.create_label.assert_called_with('testLabel', '000000')
def test_create_column(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() project = gh._create_project(repo, 'testOrg', 'testBody') gh._create_column(project, 'test') project.create_column.assert_called_with('test')
def test_delete_label(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() label = gh._create_label(repo, 'test', '000000') gh._delete_label(label) label.delete.assert_called()
def test_get_labels(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() labels = gh._get_labels(repo) repo.get_labels.assert_called() assert len(labels) == 5
def test_create_milestone(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() gh._create_milestone(repo, 'testMilestone', 'testDesc') repo.create_milestone.assert_called_with('testMilestone', description='testDesc')
def test_delete_labels(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() labels = gh._get_labels(repo) gh._delete_labels(repo) for label in labels: label.delete.assert_called()
def test_create_issue(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() gh._create_issue(repo, 'testMilestone', 'testTitle', 'testBody', []) repo.create_issue.assert_called_with('testTitle', body='testBody', milestone='testMilestone', labels=[])
def test_create_user_repo(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github user = gh._get_user() gh._create_user_repo('testRepo', 'foobar') user.create_repo.assert_called_with(name='testRepo', description='foobar', has_issues=True, auto_init=True, private=True)
def test_build_initialize_repo(fs, mock_Github): MockedFiles._mock_correct_file_system(fs) gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() gh._initialize_repo(repo, './workitems/correct', [ './workitems/correct/README.md', './workitems/correct/feature_01/attachment.doc' ])
def test_create_columns(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() project = gh._create_project(repo, 'testOrg', 'testBody') gh._create_columns(project) assert project.create_column.call_args_list == [ call('To Do'), call('In Progress'), call('Completed') ]
def test_create_card(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() project = gh._create_project(repo, 'testOrg', 'testBody') column = gh._create_column(project, 'test') issue = gh._create_issue(repo, 'testMilestone', 'testTitle', 'testBody', []) gh._create_card(column, issue) column.create_card.assert_called_with(content_id=issue.id, content_type="Issue")
def test_create_labels(mock_Github): def mock_create_label(*args, **kwargs): return Noniterable_str(args[1]) gh = GitHub(token='foo') gh.github = mock_Github repo = gh._get_user().create_repo() gh._create_label = MagicMock(side_effect=mock_create_label) names = ['test1', 'test2'] colors = ['000000', '111111'] labels = gh._create_labels(repo, names, colors) assert len(labels) == 2 assert labels[0] == 'test1' assert labels[1] == "test2"
def test_get_user(mock_Github): gh = GitHub(token='foo') gh.github = mock_Github gh._get_user() mock_Github.get_user.assert_called_with()