"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "monasca_api/tests/test_config_types.py" between
monasca-api-3.1.0.tar.gz and monasca-api-4.0.0.tar.gz

About: OpenStack Monasca API is a RESTful API server that is designed with a layered architecture and supports Monitoring as a Service (MONaaS).
The "Ussuri" series (latest release).

test_config_types.py  (monasca-api-3.1.0):test_config_types.py  (monasca-api-4.0.0)
skipping to change at line 31 skipping to change at line 31
def setUp(self): def setUp(self):
super(TestHostAddressPortType, self).setUp() super(TestHostAddressPortType, self).setUp()
self.types = types.HostAddressPortType() self.types = types.HostAddressPortType()
def test_ip_address(self): def test_ip_address(self):
self.assertEqual('127.0.0.1:2121', self.types('127.0.0.1:2121')) self.assertEqual('127.0.0.1:2121', self.types('127.0.0.1:2121'))
def test_hostname(self): def test_hostname(self):
self.assertEqual('localhost:2121', self.types('localhost:2121')) self.assertEqual('localhost:2121', self.types('localhost:2121'))
def test_ipv6_address(self):
self.assertEqual('2001:db8:85a3::8a2e:370:2121',
self.types('[2001:db8:85a3::8a2e:370]:2121'))
def test_ipv6_hostname(self):
self.assertEqual('::1:2121', self.types('[::1]:2121'))
# failure scenario # failure scenario
def test_missing_port(self): def test_missing_port(self):
self.assertRaises(ValueError, self.types, '127.0.0.1') self.assertRaises(ValueError, self.types, '127.0.0.1')
def test_missing_address(self): def test_missing_address(self):
self.assertRaises(ValueError, self.types, ':123') self.assertRaises(ValueError, self.types, ':123')
def test_incorrect_ip(self): def test_incorrect_ip(self):
self.assertRaises(ValueError, self.types, '127.surprise.0.1:2121') self.assertRaises(ValueError, self.types, '127.surprise.0.1:2121')
def test_incorrect_ipv6(self):
self.assertRaises(ValueError, self.types, '[2001:db8:8a2e:370]:2121')
def test_incorrect_port(self): def test_incorrect_port(self):
self.assertRaises(ValueError, self.types, '127.0.0.1:65536') self.assertRaises(ValueError, self.types, '127.0.0.1:65536')
self.assertRaises(ValueError, self.types, '127.0.0.1:sample') self.assertRaises(ValueError, self.types, '127.0.0.1:sample')
 End of changes. 2 change blocks. 
0 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)