Skip to content

Commit c591843

Browse files
author
Dave Mun
committed
Update test_archive.py to expects module
1 parent e8f056b commit c591843

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

tests/test_archive.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
from six import text_type, u, b, PY2, PY3
33
from nose.tools import raises
4-
from sure import expect
4+
from expects import *
55
import httpretty
66
import textwrap
77
import json
@@ -58,25 +58,25 @@ def test_stop_archive(self):
5858
archive.stop()
5959

6060
validate_jwt_header(self, httpretty.last_request().headers[u('x-opentok-auth')])
61-
expect(httpretty.last_request().headers[u('user-agent')]).to.contain(u('OpenTok-Python-SDK/')+__version__)
62-
expect(httpretty.last_request().headers[u('content-type')]).to.equal(u('application/json'))
63-
expect(archive).to.be.an(Archive)
64-
expect(archive).to.have.property(u('id')).being.equal(archive_id)
65-
expect(archive).to.have.property(u('name')).being.equal(u(''))
66-
expect(archive).to.have.property(u('status')).being.equal(u('stopped'))
67-
expect(archive).to.have.property(u('session_id')).being.equal(u('SESSIONID'))
68-
expect(archive).to.have.property(u('partner_id')).being.equal(123456)
61+
expect(httpretty.last_request().headers[u('user-agent')]).to(contain(u('OpenTok-Python-SDK/')+__version__))
62+
expect(httpretty.last_request().headers[u('content-type')]).to(equal(u('application/json')))
63+
expect(archive).to(be_an(Archive))
64+
expect(archive).to(have_property(u('id'), archive_id))
65+
expect(archive).to(have_property(u('name'), u('')))
66+
expect(archive).to(have_property(u('status'), u('stopped')))
67+
expect(archive).to(have_property(u('session_id'), u('SESSIONID')))
68+
expect(archive).to(have_property(u('partner_id'), 123456))
6969
if PY2:
7070
created_at = datetime.datetime.fromtimestamp(1395183243, pytz.UTC)
7171
if PY3:
7272
created_at = datetime.datetime.fromtimestamp(1395183243, datetime.timezone.utc)
73-
expect(archive).to.have.property(u('created_at')).being.equal(created_at)
74-
expect(archive).to.have.property(u('size')).being.equal(0)
75-
expect(archive).to.have.property(u('duration')).being.equal(0)
76-
expect(archive).to.have.property(u('has_audio')).being.equal(True)
77-
expect(archive).to.have.property(u('has_video')).being.equal(False)
78-
expect(archive).to.have.property(u('output_mode')).being.equal(OutputModes.composed)
79-
expect(archive).to.have.property(u('url')).being.equal(None)
73+
expect(archive).to(have_property(u('created_at'), created_at))
74+
expect(archive).to(have_property(u('size'), 0))
75+
expect(archive).to(have_property(u('duration'), 0))
76+
expect(archive).to(have_property(u('has_audio'), True))
77+
expect(archive).to(have_property(u('has_video'), False))
78+
expect(archive).to(have_property(u('output_mode'), OutputModes.composed))
79+
expect(archive).to(have_property(u('url'), None))
8080

8181
@httpretty.activate
8282
def test_delete_archive(self):
@@ -103,6 +103,6 @@ def test_delete_archive(self):
103103
archive.delete()
104104

105105
validate_jwt_header(self, httpretty.last_request().headers[u('x-opentok-auth')])
106-
expect(httpretty.last_request().headers[u('user-agent')]).to.contain(u('OpenTok-Python-SDK/')+__version__)
107-
expect(httpretty.last_request().headers[u('content-type')]).to.equal(u('application/json'))
106+
expect(httpretty.last_request().headers[u('user-agent')]).to(contain(u('OpenTok-Python-SDK/')+__version__))
107+
expect(httpretty.last_request().headers[u('content-type')]).to(equal(u('application/json')))
108108
# TODO: test that the object is invalidated

0 commit comments

Comments
 (0)