Esempio n. 1
0
 def test_ln(self, mock_session):
     Context().schema = create_schema_from_version('2.21')
     r1 = Resource('virtual-network', uuid='9174e7d3-865b-4faf-ab0f-c083e43fee6d')
     r2 = Resource('route-table', uuid='9174e7d3-865b-4faf-ab0f-c083e43fee6d')
     r3 = Resource('project', uuid='9174e7d3-865b-4faf-ab0f-c083e43fee6d')
     r5 = Resource('logical-router', uuid='9174e7d3-865b-4faf-ab0f-c083e43fee6d')
     self.mgr.get('ln')(resources=[r1.path, r2.path])
     self.mgr.get('ln')(resources=[r1.path, r2.path], remove=True)
     self.mgr.get('ln')(resources=[r1.path, r5.path])
     self.mgr.get('ln')(resources=[r1.path, r5.path], remove=True)
     with self.assertRaises(CommandError):
         self.mgr.get('ln')(resources=[r1.path, r3.path])
     with self.assertRaises(CommandError):
         self.mgr.get('ln')(resources=['foo/9174e7d3-865b-4faf-ab0f-c083e43fee6d', r1.path])
     Context().schema = DummySchema()
Esempio n. 2
0
 def test_ln(self, mock_session):
     Context().schema = create_schema_from_version('2.21')
     r1 = Resource('virtual-network', uuid='9174e7d3-865b-4faf-ab0f-c083e43fee6d')
     r2 = Resource('route-table', uuid='9174e7d3-865b-4faf-ab0f-c083e43fee6d')
     r3 = Resource('project', uuid='9174e7d3-865b-4faf-ab0f-c083e43fee6d')
     r5 = Resource('logical-router', uuid='9174e7d3-865b-4faf-ab0f-c083e43fee6d')
     self.mgr.get('ln')(resources=[r1.path, r2.path])
     self.mgr.get('ln')(resources=[r1.path, r2.path], remove=True)
     self.mgr.get('ln')(resources=[r1.path, r5.path])
     self.mgr.get('ln')(resources=[r1.path, r5.path], remove=True)
     with self.assertRaises(CommandError):
         self.mgr.get('ln')(resources=[r1.path, r3.path])
     with self.assertRaises(CommandError):
         self.mgr.get('ln')(resources=['foo/9174e7d3-865b-4faf-ab0f-c083e43fee6d', r1.path])
     Context().schema = DummySchema()
Esempio n. 3
0
 def test_load_non_existing_version(self):
     non_existing_version = "0"
     with self.assertRaises(schema.SchemaVersionNotAvailable):
         schema.create_schema_from_version(non_existing_version)
Esempio n. 4
0
 def test_create_all_schema_versions(self):
     for v in schema.list_available_schema_version():
         schema.create_schema_from_version(v)
 def setUp(self):
     Context().schema = schema.create_schema_from_version('2.21')
Esempio n. 6
0
 def test_create_all_schema_versions(self):
     for v in schema.list_available_schema_version():
         schema.create_schema_from_version(v)
Esempio n. 7
0
 def test_load_non_existing_version(self):
     non_existing_version = "0"
     with self.assertRaises(schema.SchemaVersionNotAvailable):
         schema.create_schema_from_version(non_existing_version)