fix(learn): tests for python video lessons (#38600)

* fix: improve tests for video challenges

* fix: remove unused challenges + get rid of no description warning

* fix: remove non-existent challenges from meta
This commit is contained in:
Tom
2020-04-21 17:19:22 -05:00
committed by Mrugesh Mohapatra
parent 03c9e47be9
commit 379f6f89ca
5 changed files with 11 additions and 58 deletions

View File

@ -1,7 +1,10 @@
const crypto = require('crypto'); const crypto = require('crypto');
function createChallengeNode(challenge, reporter) { function createChallengeNode(challenge, reporter) {
if (typeof challenge.description[0] !== 'string') { if (
typeof challenge.description[0] !== 'string' &&
challenge.challengeType !== 11
) {
reporter.warn(` reporter.warn(`
${challenge.title} has a description that will break things! ${challenge.title} has a description that will break things!

View File

@ -126,5 +126,9 @@ exports.helpCategory = {
'data-analysis-with-python-projects': 'Certification Projects', 'data-analysis-with-python-projects': 'Certification Projects',
'machine-learning-with-python': 'Certification Projects', 'machine-learning-with-python': 'Certification Projects',
'machine-learning-with-python-projects': 'Certification Projects', 'machine-learning-with-python-projects': 'Certification Projects',
'python-for-everybody': 'Python' 'python-for-everybody': 'Python',
tensorflow: 'Python',
'how-neural-networks-work': 'Python',
numpy: 'Python',
'data-analysis-with-python-course': 'Python'
}; };

View File

@ -229,34 +229,6 @@
[ [
"5e7b9f6a0b6c005b0e76f097", "5e7b9f6a0b6c005b0e76f097",
"Viz C" "Viz C"
],
[
"5e7b9f6a0b6c005b0e76f098",
"Viz Geodata"
],
[
"5e7b9f6a0b6c005b0e76f099",
"Viz Gmane Model"
],
[
"5e7b9f6b0b6c005b0e76f09a",
"Viz Gmane Spider"
],
[
"5e7b9f6b0b6c005b0e76f09b",
"Viz Gmane Viz"
],
[
"5e7b9f6b0b6c005b0e76f09c",
"Viz Page Rank"
],
[
"5e7b9f6b0b6c005b0e76f09d",
"Viz Page Spider"
],
[
"5e7b9f6c0b6c005b0e76f09e",
"Viz Page Viz"
] ]
] ]
} }

View File

@ -1,27 +0,0 @@
---
id: 5e6a54a558d3af90110a60a0
title: Introduction A
challengeType: 11
isRequired: true
videoId: 3muQV-Im3Z0
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
question:
text: 'Who should learn to program?'
answers:
- 'College students.'
- 'People who want to become software developers.'
- 'Everyone.'
solution: 3
```
</section>

View File

@ -15,7 +15,7 @@ function getSchemaForLang(lang) {
checksum: Joi.number(), checksum: Joi.number(),
dashedName: Joi.string(), dashedName: Joi.string(),
description: Joi.when('challengeType', { description: Joi.when('challengeType', {
is: challengeTypes.step, is: Joi.only([challengeTypes.step, challengeTypes.video]),
then: Joi.string().allow(''), then: Joi.string().allow(''),
otherwise: Joi.string().required() otherwise: Joi.string().required()
}), }),
@ -41,6 +41,7 @@ function getSchemaForLang(lang) {
), ),
guideUrl: Joi.string().uri({ scheme: 'https' }), guideUrl: Joi.string().uri({ scheme: 'https' }),
videoUrl: Joi.string().allow(''), videoUrl: Joi.string().allow(''),
videoId: Joi.string(),
forumTopicId: Joi.number(), forumTopicId: Joi.number(),
helpRoom: Joi.string(), helpRoom: Joi.string(),
id: Joi.objectId().required(), id: Joi.objectId().required(),