示例#1
0
    def test_read_requirements(self):
        """
        should return a list of requirements from the requirements.txt file

        """
        requirements = ['foo', 'bar>=0.1.2', 'biz>=0.2.3,<0.3.0', 'baz==1.0.1']
        with open('requirements.txt', 'w') as f:
            f.write('\n'.join(requirements) + '\n')
        self.assertEqual(spec_helpers.read_requirements(), requirements)
        os.remove('requirements.txt')
示例#2
0
 def test_read_missing_requirements(self):
     """should return an emtpy list when requirements.txt is missing"""
     self.assertEqual(spec_helpers.read_requirements(), [])