mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): check for imports in tests (#65463)
This commit is contained in:
@@ -78,20 +78,14 @@ assert _test_list == [20, 3, 14, 1, 5]
|
||||
({ test: () => runPython(`assert quick_sort([87, 11, 23, 18, 18, 23, 11, 56, 87, 56]) == [11, 11, 18, 18, 23, 23, 56, 56, 87, 87]`) })
|
||||
```
|
||||
|
||||
You should not use the built-in `sorted()` function in your code.
|
||||
You should not import any module or use built-in sorting methods in your code.
|
||||
|
||||
```js
|
||||
({ test: () => runPython(`
|
||||
assert not _Node(_code).block_has_call("sorted")
|
||||
`) })
|
||||
```
|
||||
|
||||
You should not use the `sort()` method in your code.
|
||||
|
||||
```js
|
||||
({ test: () => runPython(`
|
||||
assert not _Node(_code).block_has_call("sort")
|
||||
`) })
|
||||
assert len(_Node(_code).find_imports()) == 0
|
||||
assert not _Node(_code).block_has_call("sort")
|
||||
assert not _Node(_code).block_has_call("sorted")
|
||||
`)})
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@@ -50,12 +50,13 @@ Your `selection_sort` function should have one parameter.
|
||||
)
|
||||
```
|
||||
|
||||
You should not use the built-in `sort()` method or `sorted()` function in your code.
|
||||
You should not import any module or use built-in sorting methods in your code.
|
||||
|
||||
```js
|
||||
(
|
||||
{
|
||||
test: () => runPython(`
|
||||
assert len(_Node(_code).find_imports()) == 0
|
||||
assert not _Node(_code).block_has_call("sort")
|
||||
assert not _Node(_code).block_has_call("sorted")
|
||||
`)
|
||||
|
||||
Reference in New Issue
Block a user