def test_static_content_write_js(self): """ Test that only one filename starts with 000. """ output_root = path(u'common/static/xmodule/descriptors/js') js_file_paths = _write_js(output_root, _list_descriptors()) js_file_paths = [file_path for file_path in js_file_paths if os.path.basename(file_path).startswith('000-')] self.assertEqual(len(js_file_paths), 1) self.assertIn("XModule.Descriptor = (function () {", open(js_file_paths[0]).read())
def test_static_content_write_js(self): """ Test that only one filename starts with 000. """ output_root = path(u'common/static/xmodule/descriptors/js') file_owners = _write_js(output_root, _list_descriptors()) js_file_paths = set(file_path for file_path in sum(file_owners.values(), []) if os.path.basename(file_path).startswith('000-')) self.assertEqual(len(js_file_paths), 1) self.assertIn("XModule.Descriptor = (function() {", open(js_file_paths.pop()).read())
def test_static_content_write_js(self): """ Test that only one filename starts with 000. """ output_root = path(u'common/static/xmodule/descriptors/js') file_owners = _write_js(output_root, _list_descriptors(), 'get_studio_view_js') js_file_paths = set(file_path for file_path in sum(file_owners.values(), []) if os.path.basename(file_path).startswith('000-')) self.assertEqual(len(js_file_paths), 1) self.assertIn("XModule.Descriptor = (function() {", open(js_file_paths.pop()).read())
def test_static_content_write_js(self): """ Test that only one filename starts with 000. """ output_root = path('common/static/xmodule/descriptors/js') file_owners = _write_js(output_root, XBLOCK_CLASSES, 'get_studio_view_js') js_file_paths = {file_path for file_path in sum(list(file_owners.values()), []) if os.path.basename(file_path).startswith('000-')} # lint-amnesty, pylint: disable=line-too-long assert len(js_file_paths) == 1 assert 'XModule.Descriptor = (function() {' in open( js_file_paths.pop()).read()