MCPcopy
hub / github.com/InstaPy/InstaPy / execute_script

Method execute_script

tests/comment_util_tests.py:15–25  ·  view source on GitHub ↗
(self, script, *kwargs)

Source from the content-addressed store, hash-verified

13 self.comment_count = comment_count
14
15 def execute_script(self, script, *kwargs):
16 if "edge_media_preview_comment.count" in script:
17 return self.comment_count
18 if ".graphql.shortcode_media.comments_disabled" in script:
19 return False
20 elif "edge_media_to_caption.edges[0]['node']['text']" in script:
21 return self.caption
22 elif "edge_media_to_parent_comment.edges[0]['node']['text']" in script:
23 return self.first_comment
24 else:
25 raise ValueError("Unexpected script")
26
27
28class CommentsUtilTests(unittest.TestCase):

Callers 15

get_given_user_followingFunction · 0.80
check_browserFunction · 0.80
validate_usernameFunction · 0.80
get_active_usersFunction · 0.80
scroll_bottomFunction · 0.80
scroll_downFunction · 0.80
click_elementFunction · 0.80
get_relationship_countsFunction · 0.80
check_authorizationFunction · 0.80
get_usernameFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected