Files
python-barbicanclient/barbicanclient/tests/test_base.py
John Vrbanac beb9ac8c19 Cleaning up validate_ref()
Making validate_ref() more pythonic and readable by using the
tuple return instead. Also, added explicit tests for validate_ref.

Change-Id: Ib056050c36b2ffe8a7476c5724e26146b5fcd43c
2015-04-22 11:26:38 -05:00

15 lines
402 B
Python

import testtools
from barbicanclient import base
class TestValidateRef(testtools.TestCase):
def test_valid_ref(self):
ref = 'http://localhost/ff2ca003-5ebb-4b61-8a17-3f9c54ef6356'
self.assertTrue(base.validate_ref(ref, 'Thing'))
def test_invalid_uuid(self):
ref = 'http://localhost/not_a_uuid'
self.assertRaises(ValueError, base.validate_ref, ref, 'Thing')