-
Notifications
You must be signed in to change notification settings - Fork 406
/
Copy pathtest_issues_milestone.py
37 lines (32 loc) · 1.49 KB
/
test_issues_milestone.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import github3
from .helper import IntegrationHelper
class TestMilestone(IntegrationHelper):
def test_delete(self):
"""Test the ability to delete a milestone."""
self.token_login()
cassette_name = self.cassette_name("delete")
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository("github3py", "delete_contents")
milestone = repository.create_milestone("test-milestone")
assert milestone.delete() is True
def test_update(self):
"""Test the ability to update a milestone."""
self.token_login()
cassette_name = self.cassette_name("update")
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository("github3py", "delete_contents")
milestone = repository.create_milestone("test-milestone")
assert (
milestone.update(title="integration", description="delete me")
is True
)
assert milestone.delete() is True
def test_labels(self):
"""Test the ability to iterate over milestone labels."""
cassette_name = self.cassette_name("labels")
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue("sigmavirus24", "github3.py", 206)
milestone = issue.milestone
assert milestone is not None
for label in milestone.labels():
assert isinstance(label, github3.issues.label.ShortLabel)