Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Fixed invalid DB name test
Browse files Browse the repository at this point in the history
The HEAD on an invalid DB name that doesn't exist returns a 400 in 1.7.2 but a 404 in 1.7.1 and 2.x
  • Loading branch information
ricellis committed Feb 19, 2020
1 parent d84a0ea commit 8331efa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/client_tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright (C) 2015, 2019 IBM Corp. All rights reserved.
# Copyright (C) 2015, 2020 IBM Corp. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -405,9 +405,10 @@ def test_create_invalid_database_name(self):
"""
dbname = 'invalidDbName_'
self.client.connect()
with self.assertRaises(CloudantDatabaseException) as cm:
with self.assertRaises((CloudantDatabaseException, HTTPError)) as cm:
self.client.create_database(dbname)
self.assertEqual(cm.exception.status_code, 400)
code = cm.exception.status_code if hasattr(cm.exception, 'status_code') else cm.exception.response.status_code
self.assertEqual(code, 400)
self.client.disconnect()

@skip_if_not_cookie_auth
Expand Down

0 comments on commit 8331efa

Please sign in to comment.