forked from yvah/OpenSourceDynamics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.py
33 lines (25 loc) · 964 Bytes
/
testing.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
import classes
import json
def test_newComment():
string = """{
"author": {"login": "Frankie"},
"bodyText": "this is a comment",
"createdAt": "2023-02-16T17:20:39Z"
}"""
comment1 = classes.newComment(json.loads(string))
comment2 = classes.Comment("this is a comment", "Frankie", "2023-02-16", "17:20:39")
assert comment1 == comment2
def test_newIssue():
string = """{
"author": {"login": "Fredrick"},
"comments": {"edges": [{"node": {"author": {"login": "Frankie"},
"bodyText": "this is a comment",
"createdAt": "2023-02-16T17:20:39Z"}}]},
"number": 13,
"state": "CLOSED",
"title": "hi"
}"""
issue1 = classes.newIssueOrPullRequest(json.loads(string))
issue2 = classes.IssueOrPullRequest("hi", 13, "CLOSED", "Fredrick",
[classes.Comment("this is a comment", "Frankie", "2023-02-16", "17:20:39")])
assert issue1 == issue2