コード例 #1
0
 def test_mock_update_account(self, mock_update_account):
     user = '******'
     avatar_url = "catface"
     args = ["update", "bio", "the goat"]
     profile.process_message(user, avatar_url, args)
     self.assertEqual(mock_update_account.call_count, 1)
     args2 = ["update", "bios", "the goat"]
コード例 #2
0
 def test_profile_update(self):
     user = '******'
     avatar_url = "catface"
     args = []
     self.assertEqual(
         profile.process_message(user, avatar_url, args),
         "Update command missing parameters: !profile "
         "update {category} {value}")
     args1 = ["update"]
     self.assertEqual(
         profile.process_message(user, avatar_url, args1),
         "Update command missing parameters: !profile update {category} {value}"
     )
コード例 #3
0
 def test_mock_create_works(self, mock_create):
     user = '******'
     avatar_url = "catface"
     args = ['create']
     profile.process_message(user, avatar_url, args)
     self.assertEqual(mock_create.call_count, 1)