Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion nf_core/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def check_files_exist (self):
files_fail = [
'LICENSE',
'README.md',
'nextflow.config',
'Dockerfile',
'docs/README.md',
'nextflow.config'
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
click
Empty file.
Empty file.
Empty file.
40 changes: 40 additions & 0 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python
"""Some tests covering the linting code.
Provide example wokflow directory contents like:

--tests
|--lint_examples
| |--missing_license
| | |...<files here>
| |--missing_config
| | |....<files here>
| |...
|--test_lint.py
"""
import os
import unittest
import nf_core.lint
from nose.tools import raises

def pf(wd, path):
return os.path.join(wd, path)

WD = os.path.dirname(__file__)
PATH_CRITICAL_EXAMPLE = pf(WD, 'lint_examples/critical_example')
PATH_FAILING_EXAMPLE = pf(WD, 'lint_examples/failing_example')

class TestLint(unittest.TestCase):
"""Class for lint tests"""

@raises(AssertionError)
def test_critical_example(self):
"""Tests for missing nextflow config and main.nf files"""
lint_obj = nf_core.lint.PipelineLint(PATH_CRITICAL_EXAMPLE)
lint_obj.lint_pipeline()

def test_failing_example(self):
"""Tests for missing files like Dockerfile or LICENSE"""
lint_obj = nf_core.lint.PipelineLint(PATH_FAILING_EXAMPLE)
lint_obj.lint_pipeline()
assert len(lint_obj.failed) == 4, "Expected 6 files missing, but found %r" % len(lint_obj.failed)
assert len(lint_obj.passed) == 2, "Expected 6 files missing, but found %r" % len(lint_obj.passed)