本文整理汇总了Python中facebook.Facebook.posting_text方法的典型用法代码示例。如果您正苦于以下问题:Python Facebook.posting_text方法的具体用法?Python Facebook.posting_text怎么用?Python Facebook.posting_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类facebook.Facebook
的用法示例。
在下文中一共展示了Facebook.posting_text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AutomaticFBTest
# 需要导入模块: from facebook import Facebook [as 别名]
# 或者: from facebook.Facebook import posting_text [as 别名]
class AutomaticFBTest(unittest.TestCase):
def setUp(self, ):
parser = SafeConfigParser()
parser.read("credentials.ini")
self.user = parser.get("facebook", "user")
self.passwd = parser.get("facebook", "passwd")
# self.display = Display(visible=0, size=(800,600))
# self.display.start()
self.fb = Facebook(self.user, self.passwd)
def tearDown(self, ):
self.fb.close()
# self.display.stop()
def test_can_login(self, ):
self.assertIn("xc_message", self.fb.page_source)
def test_can_posting_a_message(self, ):
self.fb.posting_text("ini adalah bercobaan")
self.assertIn("m_home_notice", self.fb.page_source)
def test_can_post_one_image(self, ):
self.fb.posting_image(
"https://m.facebook.com/groups/1488124361496149",
"/home/sakkuun/Pictures/IMG_0029.JPG",
"coba")
self.assertIn("groupMallNotices", self.fb.page_source)
def test_can_post_multiple_image(self):
self.fb.posting_image(
"https://m.facebook.com/groups/1488124361496149",
["/home/sakkuun/Pictures/IMG_0029.JPG",
"/home/sakkuun/Pictures/IMG_0053.JPG"],
"coba multiple image"
)
self.assertIn("groupMallNotices", self.fb.page_source)
def test_can_post_into_spesified_profil(self, ):
self.fb.posting_image(
"http://m.facebook.com/mihfazhillah",
"/home/sakkuun/2015-12-08-191416_1024x600_scrot.png",
"coba foto ke profilku"
)
self.assertIn("coba foto ke profilku", self.fb.page_source)
def test_if_path_given_is_over_three_dont_panic(self):
self.fb.posting_image(
"https://m.facebook.com/groups/1488124361496149",
["/home/sakkuun/Pictures/IMG_0029.JPG",
"/home/sakkuun/Pictures/IMG_0053.JPG",
"/home/sakkuun/Pictures/IMG_0053.JPG",
"/home/sakkuun/2015-12-08-191416_1024x600_scrot.png",
"/home/sakkuun/2015-12-08-191416_1024x600_scrot.png"
],
"coba multiple image lebih dari 3"
)
self.assertIn("groupMallNotices", self.fb.page_source)