Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: appengine/auth_service/handlers_frontend_test.py

Issue 1148073005: Use luci-config for infrequently changing settings, part 2. (Closed) Base URL: git@github.com:luci/luci-py@master
Patch Set: fix pylint (??!) Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/auth_service/handlers_frontend.py ('k') | appengine/auth_service/importer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/auth_service/handlers_frontend_test.py
diff --git a/appengine/auth_service/handlers_frontend_test.py b/appengine/auth_service/handlers_frontend_test.py
index ab46c4112c195bd6d02b3dd9e0413bc59846b901..c11cc1a76504d158f21f782ff53746383ab2de4b 100755
--- a/appengine/auth_service/handlers_frontend_test.py
+++ b/appengine/auth_service/handlers_frontend_test.py
@@ -21,26 +21,26 @@ import importer
import replication
-GOOD_IMPORTER_CONFIG = [
- {
- 'domain': 'example.com',
- 'systems': ['ldap'],
- 'url': 'http://example.com/stuff.tar.gz',
- },
- {
- 'format': 'plainlist',
- 'group': 'chromium-committers',
- 'url': 'http://chromium-committers.appspot.com/chromium',
- },
-]
-
-BAD_IMPORTER_CONFIG = [
- # Missing 'url'.
- {
- 'domain': 'example.com',
- 'systems': ['ldap'],
- },
-]
+GOOD_IMPORTER_CONFIG = """
+# Comment.
+tarball {
+ domain: "example.com"
+ systems: "ldap"
+ url: "http://example.com/stuff.tar.gz"
+}
+plainlist {
+ group: "chromium-committers"
+ url: "http://chromium-committers.appspot.com/chromium"
+}
+"""
+
+BAD_IMPORTER_CONFIG = """
+# Missing 'url'.
+tarball {
+ domain: "example.com"
+ systems: "ldap"
+}
+"""
class FrontendHandlersTest(test_case.TestCase):
@@ -68,10 +68,10 @@ class FrontendHandlersTest(test_case.TestCase):
def test_importer_config_get_default(self):
response = self.app.get('/auth_service/api/v1/importer/config', status=200)
- self.assertEqual({'config': []}, response.json)
+ self.assertEqual({'config': ''}, response.json)
def test_importer_config_get(self):
- importer.write_config(GOOD_IMPORTER_CONFIG)
+ importer.write_config_text(GOOD_IMPORTER_CONFIG)
response = self.app.get('/auth_service/api/v1/importer/config', status=200)
self.assertEqual({'config': GOOD_IMPORTER_CONFIG}, response.json)
@@ -82,7 +82,7 @@ class FrontendHandlersTest(test_case.TestCase):
headers={'X-XSRF-Token': auth_testing.generate_xsrf_token_for_test()},
status=200)
self.assertEqual({'ok': True}, response.json)
- self.assertEqual(GOOD_IMPORTER_CONFIG, importer.read_config())
+ self.assertEqual(GOOD_IMPORTER_CONFIG, importer.read_config_text())
def test_importer_config_post_bad(self):
response = self.app.post_json(
@@ -90,8 +90,9 @@ class FrontendHandlersTest(test_case.TestCase):
{'config': BAD_IMPORTER_CONFIG},
headers={'X-XSRF-Token': auth_testing.generate_xsrf_token_for_test()},
status=400)
- self.assertEqual({'text': 'Invalid config format.'}, response.json)
- self.assertEqual([], importer.read_config())
+ self.assertEqual(
+ {'text': '"url" field is required in TarballEntry'}, response.json)
+ self.assertEqual('', importer.read_config_text())
def test_importer_config_post_locked(self):
self.mock(handlers_frontend.config, 'is_remote_configured', lambda: True)
« no previous file with comments | « appengine/auth_service/handlers_frontend.py ('k') | appengine/auth_service/importer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698