def test_parse_uri(self): mock_conf = mock.Mock() fake_uri = ('sheepdog://127.0.0.1:7000' ':6bd59e6e-c410-11e5-ab67-0a73f1fda51b') loc = sheepdog.StoreLocation({}, mock_conf) loc.parse_uri(fake_uri) self.assertEqual('6bd59e6e-c410-11e5-ab67-0a73f1fda51b', loc.image) self.assertEqual('127.0.0.1', loc.addr) self.assertEqual(7000, loc.port)
def test_process_spec(self): mock_conf = mock.Mock() fake_spec = { 'image': '6bd59e6e-c410-11e5-ab67-0a73f1fda51b', 'addr': '127.0.0.1', 'port': 7000, } loc = sheepdog.StoreLocation(fake_spec, mock_conf) self.assertEqual(fake_spec['image'], loc.image) self.assertEqual(fake_spec['addr'], loc.addr) self.assertEqual(fake_spec['port'], loc.port)