Permalink
Browse files

Merge pull request #13 from aaylward/master

updated test_blog.py and test_lead.py
  • Loading branch information...
YoavShapira committed Dec 19, 2011
2 parents 5530224 + e49544b commit 28ceaf07228dc9a52f973e75f409c3566de4e6be
Showing with 10 additions and 10 deletions.
  1. +6 −6 hapi/test/test_blog.py
  2. +2 −2 hapi/test/test_leads.py
  3. +2 −2 setup.py
View
@@ -103,31 +103,31 @@ def test_get_comment(self):
def test_create_post(self):
blogs = self.client.get_blogs()
blog = blogs[0]
- post_to_create = self.client.create_post(blog['guid'], 'Test Author', 'testapi@hubspot.com', 'I am a test post', 'This is a test summary', '<b>This is the content of the blog post</b>', ['tag1', 'tag2'])
+ post_to_create = self.client.create_post(blog['guid'], 'Test Author', 'testapi@hubspot.com', 'I am a test post', 'This is a test summary', '<b>This is the content of the blog post</b>', ['tag1', 'tag2'], 'test metaDescription!', 'these are totally test keywords.')
self.assertTrue(post_to_create)
- post = post_to_create.toprettyxml()
+ post = json.dumps(post_to_create)
print "Created a blog post: %s" % post
@attr('api')
def test_update_post(self):
- post_to_update = self.client.update_post('6a0626c6-98f1-4b7c-a3c0-0b5a1daabf2b', 'I am a test post title UPDATED', 'This is a test summary', '<b>This is the content of the blog post updated</b>', 'meta desc updated', ['keyword1', 'keyword2'], ['tag1', 'tag2', 'tag4'])
+ post_to_update = self.client.update_post(post_guid = '6a0626c6-98f1-4b7c-a3c0-0b5a1daabf2b', title = 'I am a test post title UPDATED', summary = 'This is a test summary', content = '<b>This is the content of the blog post updated</b>', meta_desc = 'meta desc updated', meta_keyword = 'keyword1, keyword2', tags = ['tag1', 'tag2', 'tag4'])
self.assertTrue(post_to_update)
- post = post_to_update.toprettyxml()
+ post = json.dumps(post_to_update)
print "Updated a blog post: %s" % post
@attr('api')
def test_publish_post(self):
now = "2100-03-20T10:10:00Z"
post_to_publish = self.client.publish_post('6a0626c6-98f1-4b7c-a3c0-0b5a1daabf2b', now, 0, 0)
self.assertTrue(post_to_publish)
- post = post_to_publish.toprettyxml()
+ post = json.dumps(post_to_publish)
print "Published a blog post: %s" % post
@attr('api')
def test_create_comment(self):
comment = self.client.create_comment('6a0626c6-98f1-4b7c-a3c0-0b5a1daabf2b', 'Test Comment Author', 'testapi@hubspot.com', 'http://hubspot.com', 'I am a test comment')
self.assertTrue(comment)
- posted_comment = comment.toprettyxml()
+ posted_comment = json.dumps(comment)
print "Published a blog post: %s" % posted_comment
View
@@ -28,9 +28,9 @@ def test_get_leads(self):
self.assertEquals(2, len(self.client.get_leads(max=2)))
def test_open_lead(self):
- lead_guid = self.client.get_leads(timePivot='closedAt', startTime=0)[0]['guid']
+ lead_guid = self.client.get_leads(timePivot='closedAt', startTime=0, max=1)[0]['guid']
self.client.open_lead(lead_guid)
- time.sleep(5)
+ time.sleep(3)
self.assertEquals(False, self.client.get_lead(lead_guid)['isCustomer'])
if __name__ == "__main__":
View
@@ -3,13 +3,13 @@
setup(
name='hapipy',
- version='2.4.6',
+ version='2.4.7',
description="A python wrapper around HubSpot's APIs",
long_description = open('README.md').read(),
author='HubSpot Dev Team',
author_email='devteam+hapi@hubspot.com',
url='https://github.com/HubSpot/hapipy',
- download_url='https://github.com/HubSpot/hapipy/tarball/v2.4.6',
+ download_url='https://github.com/HubSpot/hapipy/tarball/v2.4.7',
license='LICENSE.txt',
packages=['hapi'],
install_requires=[

0 comments on commit 28ceaf0

Please sign in to comment.