mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 03:55:22 +00:00
Add new options
This commit is contained in:
parent
e7b8ddf72d
commit
06e933ef3c
@ -86,7 +86,8 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test that all modules we will test upon, are in requirements file
|
Test that all modules we will test upon, are in requirements file
|
||||||
"""
|
"""
|
||||||
pipreqs.init({'<path>': self.project, '--savepath': None, '--print': False,
|
pipreqs.init({'<path>': self.project, '--savepath': None, '--print': False,
|
||||||
'--use-local': None, '--force': True, '--proxy':None, '--pypi-server':None})
|
'--use-local': None, '--force': True, '--proxy':None, '--pypi-server':None,
|
||||||
|
'--diff': None, '--clean': None})
|
||||||
assert os.path.exists(self.requirements_path) == 1
|
assert os.path.exists(self.requirements_path) == 1
|
||||||
with open(self.requirements_path, "r") as f:
|
with open(self.requirements_path, "r") as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
@ -98,7 +99,8 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test that items listed in requirements.text are the same as locals expected
|
Test that items listed in requirements.text are the same as locals expected
|
||||||
"""
|
"""
|
||||||
pipreqs.init({'<path>': self.project, '--savepath': None, '--print': False,
|
pipreqs.init({'<path>': self.project, '--savepath': None, '--print': False,
|
||||||
'--use-local': True, '--force': True, '--proxy':None, '--pypi-server':None})
|
'--use-local': True, '--force': True, '--proxy':None, '--pypi-server':None,
|
||||||
|
'--diff': None, '--clean': None})
|
||||||
assert os.path.exists(self.requirements_path) == 1
|
assert os.path.exists(self.requirements_path) == 1
|
||||||
with open(self.requirements_path, "r") as f:
|
with open(self.requirements_path, "r") as f:
|
||||||
data = f.readlines()
|
data = f.readlines()
|
||||||
@ -111,7 +113,8 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test that we can save requiremnts.tt correctly to a different path
|
Test that we can save requiremnts.tt correctly to a different path
|
||||||
"""
|
"""
|
||||||
pipreqs.init({'<path>': self.project, '--savepath':
|
pipreqs.init({'<path>': self.project, '--savepath':
|
||||||
self.alt_requirement_path, '--use-local': None, '--proxy':None, '--pypi-server':None, '--print': False})
|
self.alt_requirement_path, '--use-local': None, '--proxy':None, '--pypi-server':None, '--print': False,
|
||||||
|
"--diff": None, "--clean": None})
|
||||||
assert os.path.exists(self.alt_requirement_path) == 1
|
assert os.path.exists(self.alt_requirement_path) == 1
|
||||||
with open(self.alt_requirement_path, "r") as f:
|
with open(self.alt_requirement_path, "r") as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
@ -127,7 +130,8 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
with open(self.requirements_path, "w") as f:
|
with open(self.requirements_path, "w") as f:
|
||||||
f.write("should_not_be_overwritten")
|
f.write("should_not_be_overwritten")
|
||||||
pipreqs.init({'<path>': self.project, '--savepath': None,
|
pipreqs.init({'<path>': self.project, '--savepath': None,
|
||||||
'--use-local': None, '--force': None, '--proxy':None, '--pypi-server':None, '--print': False})
|
'--use-local': None, '--force': None, '--proxy':None, '--pypi-server':None, '--print': False,
|
||||||
|
"--diff": None, "--clean": None})
|
||||||
assert os.path.exists(self.requirements_path) == 1
|
assert os.path.exists(self.requirements_path) == 1
|
||||||
with open(self.requirements_path, "r") as f:
|
with open(self.requirements_path, "r") as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
@ -161,7 +165,9 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
'--use-local': None, '--force': True,
|
'--use-local': None, '--force': True,
|
||||||
'--proxy':None,
|
'--proxy':None,
|
||||||
'--pypi-server':None,
|
'--pypi-server':None,
|
||||||
'--ignore':'.ignored_dir,.ignore_second'
|
'--ignore':'.ignored_dir,.ignore_second',
|
||||||
|
'--diff': None,
|
||||||
|
'--clean': None
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
with open(os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r") as f:
|
with open(os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r") as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user