def testMoveTo(self): self.assertEqual({'foo': {'a': 'b', 'c': 'd'}}, MoveTo('foo/', {'a': 'b', 'c': 'd'})) self.assertEqual({'foo': {'bar': {'a': 'b', 'c': 'd'}}}, MoveTo('foo/bar/', {'a': 'b', 'c': 'd'})) self.assertEqual({'foo': {'bar': {'baz': {'a': 'b'}}}}, MoveTo('foo/bar/baz/', {'a': 'b'}))
def static_txt_update(update): return MoveTo(STATIC_DOCS, { 'static.txt': update })
def storage_html_update(update): return MoveTo(PUBLIC_TEMPLATES, { 'apps': {'storage.html': update} })
def app_yaml_update(version): return MoveTo(SERVER2, { 'app.yaml': AppYamlHelper.GenerateAppYaml(version) })
CANNED_TEST_FILE_SYSTEM_DATA = MoveTo( CHROME_EXTENSIONS, { 'api': { '_api_features.json': json.dumps({ 'ref_test': { 'dependencies': ['permission:ref_test'] }, 'tester': { 'dependencies': ['permission:tester', 'manifest:tester'] } }), '_manifest_features.json': '{}', '_permission_features.json': '{}' }, 'docs': { 'templates': { 'articles': { 'test_article.html': '<h1>hi</h1>you<h2>first</h2><h3>inner</h3><h2>second</h2>' }, 'intros': { 'test_intro.html': 'you<h2>first</h2><h3>inner</h3><h2>second</h2>' }, 'json': { 'api_availabilities.json': json.dumps({ 'trunk_api': { 'channel': 'trunk' }, 'dev_api': { 'channel': 'dev' }, 'beta_api': { 'channel': 'beta' }, 'stable_api': { 'channel': 'stable', 'version': 20 } }), 'intro_tables.json': json.dumps({ 'tester': { 'Permissions': [{ 'class': 'override', 'text': '"tester"' }, { 'text': 'is an API for testing things.' }], 'Learn More': [{ 'link': 'https://tester.test.com/welcome.html', 'text': 'Welcome!' }] } }), 'manifest.json': '{}', 'permissions.json': '{}' }, 'private': { 'intro_tables': { 'trunk_message.html': 'available on trunk' }, 'table_of_contents.html': '<table-of-contents>', } } } })
def apply_update(update): update = MoveTo(SERVER2, update) file_system_at_head.Update(update) updates.append(update)