MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / test_project

Function test_project

tests/test_project.py:7–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def test_project():
8 if not credentials_available():
9 warnings.warn("Skipped test_project because there were no credentials available.")
10 return
11 sess = session()
12
13 # project = sess.connect_project(104)
14 # tree = project.remix_tree_pretty()
15 # assert len(tree) > 1000 # there is a lot of chars. Just assert that sth is generated
16
17 # unshared project
18 project = sess.connect_project(1315253799)
19 assert project
20 assert project.title == "Unshared with comments"
21 assert project.author_name == "ScratchAttachV2"
22 assert project.embed_url == "https://scratch.mit.edu/projects/1315253799/embed"
23 assert not project.is_shared()
24 assert project.author().id == 147905216
25 comment = project.comments()[0]
26 assert comment.author_name == "faretek"
27 assert comment.content == "Second sample comment"
28 assert comment.id == 544358507
29 reply = comment.replies()[0]
30 assert reply.content == "sample reply"
31 assert reply.commentee_id == 143593913
32 assert reply.author_name == "ScratchAttachV2"
33
34 project = sess.connect_project(1209355136)
35 assert project
36 assert project.title == "Sample project #1"
37 assert project.author_name == "ScratchAttachV2"
38 assert project.embed_url == "https://scratch.mit.edu/projects/1209355136/embed"
39 assert project.is_shared()
40 # create_remix
41 # load_description
42 # download
43 # get_json
44 # body
45 # raw_json
46 # raw_json_or_empty
47 # creator_agent
48 assert project.author().id == 147905216
49 # studios
50 # TODO: move this to a separate comment tester
51 comment = project.comments()[0]
52 # comment_by_id
53 # comment_replies
54 # comment by id
55 # (un)love
56 # (un)favorite
57 # pos_view
58 # set_fields
59 # turn on/off/toggle commenting
60 # (un)share
61 # set thumb
62 # delete comment
63 # report comment
64 # post/reply comment

Callers 1

test_project.pyFile · 0.70

Calls 11

credentials_availableFunction · 0.90
sessionFunction · 0.90
allow_beforeFunction · 0.90
connect_projectMethod · 0.80
is_sharedMethod · 0.80
repliesMethod · 0.80
remixesMethod · 0.80
explore_projectsMethod · 0.80
search_projectsMethod · 0.80
authorMethod · 0.45
commentsMethod · 0.45

Tested by

no test coverage detected