From 8e670a0aa2e1d61145a38b9f915b6fdd67429c47 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 11 Apr 2018 16:59:22 -0700 Subject: fix examples/tests --- tests/test_backend.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/test_backend.py b/tests/test_backend.py index 23016e09..345c8a95 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -14,9 +14,9 @@ import tempfile def check_entity_fields(e): for key in ('id', 'rev', 'previous', 'state', 'redirect_id', 'edit_id', 'extra_json'): - assert_in(key, e) + assert key in e for key in ('id', 'rev'): - assert_is_not_none(e[key]) + assert e[key] is not None ## API Tests ################################################################ @@ -41,17 +41,17 @@ class FatcatTestCase(unittest.TestCase): # Missing Id (TODO) #rv = self.app.get('/v0/work/rzga5b9cd7efgh04iljk') - #assert rv.status is 404 + #assert rv.status == 404 - return pytest.skip("need to put first") + # Valid Id (TODO) + #rv = self.app.get('/v0/work/r3zga5b9cd7ef8gh084714iljk') + #assert rv.status_code == 200 - # Valid Id - rv = self.app.get('/v0/work/r3zga5b9cd7ef8gh084714iljk') - assert rv.status_code == 200 + rv = self.app.get('/v0/work/random') obj = json.loads(rv.data.decode('utf-8')) check_entity_fields(obj) assert obj['title'] - assert_equal(obj['work_type'], "journal-article") + assert obj['work_type'] == "journal-article" def test_something(self): -- cgit v1.2.3