| Index: appengine/config_service/services_test.py
|
| diff --git a/appengine/config_service/services_test.py b/appengine/config_service/services_test.py
|
| new file mode 100755
|
| index 0000000000000000000000000000000000000000..6504a076cc47c5377fc6e55bf8c228b022eb0c81
|
| --- /dev/null
|
| +++ b/appengine/config_service/services_test.py
|
| @@ -0,0 +1,48 @@
|
| +#!/usr/bin/env python
|
| +# Copyright 2015 The Swarming Authors. All rights reserved.
|
| +# Use of this source code is governed by the Apache v2.0 license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +from test_env import future
|
| +import test_env
|
| +test_env.setup_test_env()
|
| +
|
| +import mock
|
| +from test_support import test_case
|
| +
|
| +from proto import service_config_pb2
|
| +import services
|
| +import storage
|
| +
|
| +
|
| +class ProjectsTestCase(test_case.TestCase):
|
| + def test_dict_to_dynamic_metadata(self):
|
| + with self.assertRaises(services.DynamicMetadataError):
|
| + services._dict_to_dynamic_metadata([])
|
| +
|
| + self.assertEqual(
|
| + services._dict_to_dynamic_metadata({
|
| + 'validation': {
|
| + 'url': 'https://a.com/validate',
|
| + 'patterns': [
|
| + {'config_set': 'projects/foo', 'path': 'bar.cfg'},
|
| + {'config_set': 'regex:services/.+', 'path': 'regex:.+'},
|
| + ]
|
| + }
|
| + }),
|
| + service_config_pb2.ServiceDynamicMetadata(
|
| + validation=service_config_pb2.Validator(
|
| + url='https://a.com/validate',
|
| + patterns=[
|
| + service_config_pb2.ConfigPattern(
|
| + config_set='projects/foo', path='bar.cfg'),
|
| + service_config_pb2.ConfigPattern(
|
| + config_set='regex:services/.+', path='regex:.+'),
|
| + ]
|
| + )
|
| + )
|
| + )
|
| +
|
| +
|
| +if __name__ == '__main__':
|
| + test_env.main()
|
|
|