Ejemplo n.º 1
0
 def test_req_in_multi_docstring(self):
     with open("tests/test_files/req_all.py") as f:
         parsed = parsing._parse_docstring(f)
     # Only module requirements was found
     self.assertDictEqual(parsed, {
         REPO_PYPI: [get_req('foo==1.4')]
     })
Ejemplo n.º 2
0
 def test_req_in_multi_docstring(self):
     with open("tests/test_files/req_all.py") as f:
         parsed = parsing._parse_docstring(f)
     # Only module requirements was found
     self.assertDictEqual(parsed, {
         REPO_PYPI: [get_req('foo==1.4')]
     })
Ejemplo n.º 3
0
 def test_mixed_backends(self):
     with open("tests/test_files/req_mixed_backends.py") as f:
         parsed = parsing._parse_docstring(f)
     # Only module requirements was found
     self.assertDictEqual(parsed, {
         REPO_PYPI: [get_req('foo'), get_req('bar')],
         REPO_VCS: [parsing.VCSDependency('git+http://whatever'),
                    parsing.VCSDependency('anotherurl')],
     })
Ejemplo n.º 4
0
 def test_mixed_backends(self):
     with open("tests/test_files/req_mixed_backends.py") as f:
         parsed = parsing._parse_docstring(f)
     # Only module requirements was found
     self.assertDictEqual(parsed, {
         REPO_PYPI: [get_req('foo'), get_req('bar')],
         REPO_VCS: [parsing.VCSDependency('git+http://whatever'),
                    parsing.VCSDependency('anotherurl')],
     })
Ejemplo n.º 5
0
def test_mixed_backends():
    with open("tests/test_files/req_mixed_backends.py") as f:
        parsed = parsing._parse_docstring(f)
    # Only module requirements was found
    assert parsed == {
        REPO_PYPI:
        get_reqs("foo", "bar"),
        REPO_VCS: [
            parsing.VCSDependency("git+http://whatever"),
            parsing.VCSDependency("anotherurl"),
        ],
    }
Ejemplo n.º 6
0
    def test_empty(self):
        parsed = parsing._parse_docstring(io.StringIO("""

        """))
        self.assertDictEqual(parsed, {})
Ejemplo n.º 7
0
 def test_fades_word_as_part_of_text(self):
     with open("tests/test_files/fades_as_part_of_other_word.py") as f:
         parsed = parsing._parse_docstring(f)
     self.assertDictEqual(parsed, {})
Ejemplo n.º 8
0
 def test_req_in_def_docstring(self):
     with open("tests/test_files/req_def.py") as f:
         parsed = parsing._parse_docstring(f)
     # no requirements found
     self.assertDictEqual(parsed, {})
Ejemplo n.º 9
0
 def test_req_in_module_docstring_one_doublequote(self):
     with open("tests/test_files/req_module_3.py") as f:
         parsed = parsing._parse_docstring(f)
     self.assertDictEqual(parsed, {})
Ejemplo n.º 10
0
 def test_req_in_module_docstring_triple_singlequote(self):
     with open("tests/test_files/req_module_2.py") as f:
         parsed = parsing._parse_docstring(f)
     self.assertDictEqual(
         parsed,
         {REPO_PYPI: [get_req('foo'), get_req('bar')]})
Ejemplo n.º 11
0
def test_req_in_module_docstring_triple_singlequote():
    with open("tests/test_files/req_module_2.py") as f:
        parsed = parsing._parse_docstring(f)
    assert parsed == {REPO_PYPI: get_reqs("foo", "bar")}
Ejemplo n.º 12
0
def test_req_in_module_docstring_one_doublequote():
    with open("tests/test_files/req_module_3.py") as f:
        parsed = parsing._parse_docstring(f)
    assert parsed == {}
Ejemplo n.º 13
0
 def test_req_in_module_docstring_one_doublequote(self):
     with open("tests/test_files/req_module_3.py") as f:
         parsed = parsing._parse_docstring(f)
     self.assertDictEqual(parsed, {})
Ejemplo n.º 14
0
 def test_only_comment(self):
     with open("tests/test_files/no_req.py") as f:
         parsed = parsing._parse_docstring(f)
     self.assertDictEqual(parsed, {})
Ejemplo n.º 15
0
def test_req_in_def_docstring():
    with open("tests/test_files/req_def.py") as f:
        parsed = parsing._parse_docstring(f)
    # no requirements found
    assert parsed == {}
Ejemplo n.º 16
0
def test_empty():
    parsed = parsing._parse_docstring(io.StringIO("""

        """))
    assert parsed == {}
Ejemplo n.º 17
0
def test_fades_word_as_part_of_text():
    with open("tests/test_files/fades_as_part_of_other_word.py") as f:
        parsed = parsing._parse_docstring(f)
    assert parsed == {}
Ejemplo n.º 18
0
def test_req_in_multi_docstring():
    with open("tests/test_files/req_all.py") as f:
        parsed = parsing._parse_docstring(f)
    # Only module requirements was found
    assert parsed == {REPO_PYPI: get_reqs("foo==1.4")}
Ejemplo n.º 19
0
 def test_req_in_module_docstring_triple_singlequote(self):
     with open("tests/test_files/req_module_2.py") as f:
         parsed = parsing._parse_docstring(f)
     self.assertDictEqual(parsed, {
         REPO_PYPI: [get_req('foo'), get_req('bar')]
     })
Ejemplo n.º 20
0
    def test_empty(self):
        parsed = parsing._parse_docstring(io.StringIO("""

        """))
        self.assertDictEqual(parsed, {})
Ejemplo n.º 21
0
 def test_req_in_def_docstring(self):
     with open("tests/test_files/req_def.py") as f:
         parsed = parsing._parse_docstring(f)
     # no requirements found
     self.assertDictEqual(parsed, {})
Ejemplo n.º 22
0
 def test_only_comment(self):
     with open("tests/test_files/no_req.py") as f:
         parsed = parsing._parse_docstring(f)
     self.assertDictEqual(parsed, {})
Ejemplo n.º 23
0
 def test_fades_word_as_part_of_text(self):
     with open("tests/test_files/fades_as_part_of_other_word.py") as f:
         parsed = parsing._parse_docstring(f)
     self.assertDictEqual(parsed, {})
Ejemplo n.º 24
0
def test_only_comment():
    with open("tests/test_files/no_req.py") as f:
        parsed = parsing._parse_docstring(f)
    assert parsed == {}